1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

Show all available action list icons in UIExamples

Summary:
Make the example page a little more useful by showing available icons.

Also replace the "new" image, it had a little arrow which I thought was a "+". Use the one with a "+".

Test Plan: {F21966}

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3794
This commit is contained in:
epriestley 2012-10-23 12:00:28 -07:00
parent 0c48c1f487
commit 70dc3f5004
5 changed files with 51 additions and 35 deletions

View file

@ -203,29 +203,10 @@ $action_template = id(new PhutilSprite())
->setSourcePosition(0, 0)
->setSourceSize(16, 16);
$action_map = array(
'file' => 'icon/page_white_text.png',
'fork' => 'icon/arrow_branch.png',
'edit' => 'icon/page_white_edit.png',
'flag-0' => 'icon/flag-0.png',
'flag-1' => 'icon/flag-1.png',
'flag-2' => 'icon/flag-2.png',
'flag-3' => 'icon/flag-3.png',
'flag-4' => 'icon/flag-4.png',
'flag-5' => 'icon/flag-5.png',
'flag-6' => 'icon/flag-6.png',
'flag-7' => 'icon/flag-7.png',
'flag-ghost' => 'icon/flag-ghost.png',
'subscribe-auto' => 'icon/unsubscribe.png',
'subscribe-add' => 'icon/subscribe.png',
'subscribe-delete' => 'icon/unsubscribe.png',
'new' => 'icon/page_white_put.png',
'world' => 'icon/world.png',
'delete' => 'icon/page_delete.png',
'move' => 'icon/page_go.png',
'preview' => 'icon/page_world.png',
'unpublish' => 'icon/page_error.png',
);
$action_icons = PhabricatorActionView::getAvailableIcons();
foreach ($action_icons as $icon) {
$action_map[$icon] = 'icon/'.$icon.'.png';
}
foreach ($action_map as $icon => $source) {
$sheet->addSprite(

View file

@ -108,6 +108,16 @@ final class PhabricatorActionListExample extends PhabricatorUIExample {
->setName('Form + Workflow Action')
->setIcon('file'));
foreach (PhabricatorActionView::getAvailableIcons() as $icon) {
$view->addAction(
id(new PhabricatorActionView())
->setUser($user)
->setHref('#')
->setDisabled(true)
->setName('Icon "'.$icon.'"')
->setIcon($icon));
}
return array(
$view,
'<div style="clear: both;"></div>',

View file

@ -129,5 +129,30 @@ final class PhabricatorActionView extends AphrontView {
$icon.$item);
}
public static function getAvailableIcons() {
return array(
'delete',
'edit',
'file',
'flag-0',
'flag-1',
'flag-2',
'flag-3',
'flag-4',
'flag-5',
'flag-6',
'flag-7',
'flag-ghost',
'fork',
'move',
'new',
'preview',
'subscribe-add',
'subscribe-auto',
'subscribe-delete',
'unpublish',
'world',
);
}
}

View file

@ -708,15 +708,15 @@
background-position: 0px -7254px;
}
.action-file {
.action-delete {
background-position: 0px -7285px;
}
.action-fork {
.action-edit {
background-position: 0px -7302px;
}
.action-edit {
.action-file {
background-position: 0px -7319px;
}
@ -756,39 +756,39 @@
background-position: 0px -7472px;
}
.action-subscribe-auto {
.action-fork {
background-position: 0px -7489px;
}
.action-subscribe-add {
.action-move {
background-position: 0px -7506px;
}
.action-subscribe-delete {
.action-new {
background-position: 0px -7523px;
}
.action-new {
.action-preview {
background-position: 0px -7540px;
}
.action-world {
.action-subscribe-add {
background-position: 0px -7557px;
}
.action-delete {
.action-subscribe-auto {
background-position: 0px -7574px;
}
.action-move {
.action-subscribe-delete {
background-position: 0px -7591px;
}
.action-preview {
.action-unpublish {
background-position: 0px -7608px;
}
.action-unpublish {
.action-world {
background-position: 0px -7625px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB