diff --git a/src/applications/audit/events/AuditPeopleMenuEventListener.php b/src/applications/audit/events/AuditPeopleMenuEventListener.php index 9ba64d84c1..623ddc19a1 100644 --- a/src/applications/audit/events/AuditPeopleMenuEventListener.php +++ b/src/applications/audit/events/AuditPeopleMenuEventListener.php @@ -26,7 +26,8 @@ final class AuditPeopleMenuEventListener extends PhutilEventListener { $href = '/audit/view/author/'.$username.'/'; $actions[] = id(new PhabricatorActionView()) - ->setIcon('transcript') + ->setIcon('audit-dark') + ->setIconSheet(PHUIIconView::SPRITE_APPS) ->setName(pht('View Commits')) ->setHref($href); diff --git a/src/applications/differential/events/DifferentialPeopleMenuEventListener.php b/src/applications/differential/events/DifferentialPeopleMenuEventListener.php index 7c1a88ee51..33551ce59f 100644 --- a/src/applications/differential/events/DifferentialPeopleMenuEventListener.php +++ b/src/applications/differential/events/DifferentialPeopleMenuEventListener.php @@ -27,7 +27,8 @@ final class DifferentialPeopleMenuEventListener extends PhutilEventListener { $actions[] = id(new PhabricatorActionView()) ->setUser($event->getUser()) ->setRenderAsForm(true) - ->setIcon('transcript') + ->setIcon('differential-dark') + ->setIconSheet(PHUIIconView::SPRITE_APPS) ->setName(pht('View Revisions')) ->setHref($href); diff --git a/src/applications/maniphest/event/ManiphestPeopleMenuEventListener.php b/src/applications/maniphest/event/ManiphestPeopleMenuEventListener.php index 76da62a57a..476fd8f513 100644 --- a/src/applications/maniphest/event/ManiphestPeopleMenuEventListener.php +++ b/src/applications/maniphest/event/ManiphestPeopleMenuEventListener.php @@ -25,7 +25,8 @@ final class ManiphestPeopleMenuEventListener extends PhutilEventListener { $actions = $event->getValue('actions'); $actions[] = id(new PhabricatorActionView()) - ->setIcon('transcript') + ->setIcon('maniphest-dark') + ->setIconSheet(PHUIIconView::SPRITE_APPS) ->setName(pht('View Tasks')) ->setHref($href); diff --git a/src/view/layout/PhabricatorActionView.php b/src/view/layout/PhabricatorActionView.php index 0b1955ca28..697b595c6d 100644 --- a/src/view/layout/PhabricatorActionView.php +++ b/src/view/layout/PhabricatorActionView.php @@ -4,6 +4,7 @@ final class PhabricatorActionView extends AphrontView { private $name; private $icon; + private $iconSheet; private $href; private $disabled; private $workflow; @@ -29,6 +30,11 @@ final class PhabricatorActionView extends AphrontView { return $this; } + public function setIconSheet($sheet) { + $this->iconSheet = $sheet; + return $this; + } + public function setName($name) { $this->name = $name; return $this; @@ -53,20 +59,17 @@ final class PhabricatorActionView extends AphrontView { $icon = null; if ($this->icon) { + $sheet = nonempty($this->iconSheet, PHUIIconView::SPRITE_ICONS); $suffix = ''; if ($this->disabled) { $suffix = '-grey'; } - require_celerity_resource('sprite-icons-css'); - $icon = phutil_tag( - 'span', - array( - 'class' => 'phabricator-action-view-icon sprite-icons '. - 'icons-'.$this->icon.$suffix, - ), - ''); + $icon = id(new PHUIIconView()) + ->addClass('phabricator-action-view-icon') + ->setSpriteIcon($this->icon.$suffix) + ->setSpriteSheet($sheet); } if ($this->href) {