Replace ActionHeader minicons with Font icons
Summary: Ref T5885. See D10276. Currently, ActionHeaders can only have minicons, and we don't use them anywhere and they probably don't make much sense in the product anymore. Instead, allow them to have font icons. Remove minicons, which have no callsites and probably won't in the future. Test Plan: {F190925} - Grepped for `minicons`. - Grepped for `setHeaderIcon()`. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T5885 Differential Revision: https://secure.phabricator.com/D10277
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
return array(
|
return array(
|
||||||
'names' => array(
|
'names' => array(
|
||||||
'core.pkg.css' => '383d0947',
|
'core.pkg.css' => '1733ae8f',
|
||||||
'core.pkg.js' => '7c8455ef',
|
'core.pkg.js' => '7c8455ef',
|
||||||
'darkconsole.pkg.js' => 'df001cab',
|
'darkconsole.pkg.js' => 'df001cab',
|
||||||
'differential.pkg.css' => '4a93db37',
|
'differential.pkg.css' => '4a93db37',
|
||||||
|
@ -130,7 +130,7 @@ return array(
|
||||||
'rsrc/css/phui/phui-form-view.css' => 'ebac1b1d',
|
'rsrc/css/phui/phui-form-view.css' => 'ebac1b1d',
|
||||||
'rsrc/css/phui/phui-form.css' => 'b78ec020',
|
'rsrc/css/phui/phui-form.css' => 'b78ec020',
|
||||||
'rsrc/css/phui/phui-header-view.css' => '39594ac0',
|
'rsrc/css/phui/phui-header-view.css' => '39594ac0',
|
||||||
'rsrc/css/phui/phui-icon.css' => 'd8526aa1',
|
'rsrc/css/phui/phui-icon.css' => 'b4963a4f',
|
||||||
'rsrc/css/phui/phui-image-mask.css' => '5a8b09c8',
|
'rsrc/css/phui/phui-image-mask.css' => '5a8b09c8',
|
||||||
'rsrc/css/phui/phui-info-panel.css' => '27ea50a1',
|
'rsrc/css/phui/phui-info-panel.css' => '27ea50a1',
|
||||||
'rsrc/css/phui/phui-list.css' => '43ed2d93',
|
'rsrc/css/phui/phui-list.css' => '43ed2d93',
|
||||||
|
@ -154,7 +154,6 @@ return array(
|
||||||
'rsrc/css/sprite-login.css' => '878ee4d8',
|
'rsrc/css/sprite-login.css' => '878ee4d8',
|
||||||
'rsrc/css/sprite-main-header.css' => '92720ee2',
|
'rsrc/css/sprite-main-header.css' => '92720ee2',
|
||||||
'rsrc/css/sprite-menu.css' => '28281e16',
|
'rsrc/css/sprite-menu.css' => '28281e16',
|
||||||
'rsrc/css/sprite-minicons.css' => 'df4f76fe',
|
|
||||||
'rsrc/css/sprite-payments.css' => 'cc085d44',
|
'rsrc/css/sprite-payments.css' => 'cc085d44',
|
||||||
'rsrc/css/sprite-projects.css' => '7578fa56',
|
'rsrc/css/sprite-projects.css' => '7578fa56',
|
||||||
'rsrc/css/sprite-tokens.css' => '1706b943',
|
'rsrc/css/sprite-tokens.css' => '1706b943',
|
||||||
|
@ -333,8 +332,6 @@ return array(
|
||||||
'rsrc/image/sprite-main-header.png' => '83521873',
|
'rsrc/image/sprite-main-header.png' => '83521873',
|
||||||
'rsrc/image/sprite-menu-X2.png' => '39d78f97',
|
'rsrc/image/sprite-menu-X2.png' => '39d78f97',
|
||||||
'rsrc/image/sprite-menu.png' => '259dab45',
|
'rsrc/image/sprite-menu.png' => '259dab45',
|
||||||
'rsrc/image/sprite-minicons-X2.png' => '55377e4e',
|
|
||||||
'rsrc/image/sprite-minicons.png' => '272644ea',
|
|
||||||
'rsrc/image/sprite-payments.png' => 'd8576309',
|
'rsrc/image/sprite-payments.png' => 'd8576309',
|
||||||
'rsrc/image/sprite-projects-X2.png' => '218fdc8b',
|
'rsrc/image/sprite-projects-X2.png' => '218fdc8b',
|
||||||
'rsrc/image/sprite-projects.png' => '631ff9a7',
|
'rsrc/image/sprite-projects.png' => '631ff9a7',
|
||||||
|
@ -780,7 +777,7 @@ return array(
|
||||||
'phui-form-css' => 'b78ec020',
|
'phui-form-css' => 'b78ec020',
|
||||||
'phui-form-view-css' => 'ebac1b1d',
|
'phui-form-view-css' => 'ebac1b1d',
|
||||||
'phui-header-view-css' => '39594ac0',
|
'phui-header-view-css' => '39594ac0',
|
||||||
'phui-icon-view-css' => 'd8526aa1',
|
'phui-icon-view-css' => 'b4963a4f',
|
||||||
'phui-image-mask-css' => '5a8b09c8',
|
'phui-image-mask-css' => '5a8b09c8',
|
||||||
'phui-info-panel-css' => '27ea50a1',
|
'phui-info-panel-css' => '27ea50a1',
|
||||||
'phui-list-view-css' => '43ed2d93',
|
'phui-list-view-css' => '43ed2d93',
|
||||||
|
@ -823,7 +820,6 @@ return array(
|
||||||
'sprite-login-css' => '878ee4d8',
|
'sprite-login-css' => '878ee4d8',
|
||||||
'sprite-main-header-css' => '92720ee2',
|
'sprite-main-header-css' => '92720ee2',
|
||||||
'sprite-menu-css' => '28281e16',
|
'sprite-menu-css' => '28281e16',
|
||||||
'sprite-minicons-css' => 'df4f76fe',
|
|
||||||
'sprite-payments-css' => 'cc085d44',
|
'sprite-payments-css' => 'cc085d44',
|
||||||
'sprite-projects-css' => '7578fa56',
|
'sprite-projects-css' => '7578fa56',
|
||||||
'sprite-tokens-css' => '1706b943',
|
'sprite-tokens-css' => '1706b943',
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
{
|
|
||||||
"version" : 1,
|
|
||||||
"sprites" : {
|
|
||||||
"minicons-company-dark" : {
|
|
||||||
"name" : "minicons-company-dark",
|
|
||||||
"rule" : ".minicons-company-dark",
|
|
||||||
"hash" : "fbe746dfff63470103b6a28f52005795"
|
|
||||||
},
|
|
||||||
"minicons-company-white" : {
|
|
||||||
"name" : "minicons-company-white",
|
|
||||||
"rule" : ".minicons-company-white",
|
|
||||||
"hash" : "6dcede529bc27cc3491d8de750d3fd52"
|
|
||||||
},
|
|
||||||
"minicons-move-dark" : {
|
|
||||||
"name" : "minicons-move-dark",
|
|
||||||
"rule" : ".minicons-move-dark",
|
|
||||||
"hash" : "72ec71b4385b181a5c31bbc4ca5f33c6"
|
|
||||||
},
|
|
||||||
"minicons-move-white" : {
|
|
||||||
"name" : "minicons-move-white",
|
|
||||||
"rule" : ".minicons-move-white",
|
|
||||||
"hash" : "6fcd2e10e216ef67c5b89d32ecff951f"
|
|
||||||
},
|
|
||||||
"minicons-public-dark" : {
|
|
||||||
"name" : "minicons-public-dark",
|
|
||||||
"rule" : ".minicons-public-dark",
|
|
||||||
"hash" : "046d7814e36f9961400c82a9f13c7e00"
|
|
||||||
},
|
|
||||||
"minicons-public-white" : {
|
|
||||||
"name" : "minicons-public-white",
|
|
||||||
"rule" : ".minicons-public-white",
|
|
||||||
"hash" : "da5c297550069789eae47b9137387c5d"
|
|
||||||
},
|
|
||||||
"minicons-restricted-dark" : {
|
|
||||||
"name" : "minicons-restricted-dark",
|
|
||||||
"rule" : ".minicons-restricted-dark",
|
|
||||||
"hash" : "c04acaccae9ff70686d93f3c24557144"
|
|
||||||
},
|
|
||||||
"minicons-restricted-white" : {
|
|
||||||
"name" : "minicons-restricted-white",
|
|
||||||
"rule" : ".minicons-restricted-white",
|
|
||||||
"hash" : "c9bac60de30a2c5bb937d4da83d87c16"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"scales" : [
|
|
||||||
1,
|
|
||||||
2
|
|
||||||
],
|
|
||||||
"header" : "\/**\n * @provides sprite-minicons-css\n * @generated\n *\/\n\n.sprite-minicons {\n background-image: url(\/rsrc\/image\/sprite-minicons.png);\n background-repeat: no-repeat;\n}\n\n@media\nonly screen and (min-device-pixel-ratio: 1.5),\nonly screen and (-webkit-min-device-pixel-ratio: 1.5) {\n .sprite-minicons {\n background-image: url(\/rsrc\/image\/sprite-minicons-X2.png);\n background-size: {X}px {Y}px;\n }\n}\n",
|
|
||||||
"type" : "standard"
|
|
||||||
}
|
|
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.8 KiB |
|
@ -29,7 +29,6 @@ $generator = new CeleritySpriteGenerator();
|
||||||
$sheets = array(
|
$sheets = array(
|
||||||
'menu' => $generator->buildMenuSheet(),
|
'menu' => $generator->buildMenuSheet(),
|
||||||
'apps' => $generator->buildAppsSheet(),
|
'apps' => $generator->buildAppsSheet(),
|
||||||
'minicons' => $generator->buildMiniconsSheet(),
|
|
||||||
'conpherence' => $generator->buildConpherenceSheet(),
|
'conpherence' => $generator->buildConpherenceSheet(),
|
||||||
'apps-large' => $generator->buildAppsLargeSheet(),
|
'apps-large' => $generator->buildAppsLargeSheet(),
|
||||||
'payments' => $generator->buildPaymentsSheet(),
|
'payments' => $generator->buildPaymentsSheet(),
|
||||||
|
|
|
@ -55,36 +55,48 @@ final class PHUIActionHeaderExample extends PhabricatorUIExample {
|
||||||
|
|
||||||
/* Policy Icons */
|
/* Policy Icons */
|
||||||
$title2 = id(new PHUIHeaderView())
|
$title2 = id(new PHUIHeaderView())
|
||||||
->setHeader(pht('With Policy Icons'));
|
->setHeader(pht('With Icons'));
|
||||||
|
|
||||||
$header1 = id(new PHUIActionHeaderView())
|
$header1 = id(new PHUIActionHeaderView())
|
||||||
->setHeaderTitle('Company')
|
->setHeaderTitle('Quack')
|
||||||
->setHeaderIcon('company-dark');
|
->setHeaderIcon(
|
||||||
|
id(new PHUIIconView())
|
||||||
|
->setIconFont('fa-coffee'));
|
||||||
|
|
||||||
$header2 = id(new PHUIActionHeaderView())
|
$header2 = id(new PHUIActionHeaderView())
|
||||||
->setHeaderTitle('Public')
|
->setHeaderTitle('Moo')
|
||||||
->setHeaderColor(PHUIActionHeaderView::HEADER_GREY)
|
->setHeaderColor(PHUIActionHeaderView::HEADER_GREY)
|
||||||
->setHeaderIcon('public-dark');
|
->setHeaderIcon(
|
||||||
|
id(new PHUIIconView())
|
||||||
|
->setIconFont('fa-magic'));
|
||||||
|
|
||||||
$header3 = id(new PHUIActionHeaderView())
|
$header3 = id(new PHUIActionHeaderView())
|
||||||
->setHeaderTitle('Restricted')
|
->setHeaderTitle('Woof')
|
||||||
->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTBLUE)
|
->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTBLUE)
|
||||||
->setHeaderIcon('restricted-white');
|
->setHeaderIcon(
|
||||||
|
id(new PHUIIconView())
|
||||||
|
->setIconFont('fa-fighter-jet'));
|
||||||
|
|
||||||
$header4 = id(new PHUIActionHeaderView())
|
$header4 = id(new PHUIActionHeaderView())
|
||||||
->setHeaderTitle('Company')
|
->setHeaderTitle('Buzz')
|
||||||
->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTGREEN)
|
->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTGREEN)
|
||||||
->setHeaderIcon('company-white');
|
->setHeaderIcon(
|
||||||
|
id(new PHUIIconView())
|
||||||
|
->setIconFont('fa-child'));
|
||||||
|
|
||||||
$header5 = id(new PHUIActionHeaderView())
|
$header5 = id(new PHUIActionHeaderView())
|
||||||
->setHeaderTitle('Public')
|
->setHeaderTitle('Fizz')
|
||||||
->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTRED)
|
->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTRED)
|
||||||
->setHeaderIcon('public-white');
|
->setHeaderIcon(
|
||||||
|
id(new PHUIIconView())
|
||||||
|
->setIconFont('fa-car'));
|
||||||
|
|
||||||
$header6 = id(new PHUIActionHeaderView())
|
$header6 = id(new PHUIActionHeaderView())
|
||||||
->setHeaderTitle('Restricted')
|
->setHeaderTitle('Blarp')
|
||||||
->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTVIOLET)
|
->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTVIOLET)
|
||||||
->setHeaderIcon('restriced-white');
|
->setHeaderIcon(
|
||||||
|
id(new PHUIIconView())
|
||||||
|
->setIconFont('fa-truck'));
|
||||||
|
|
||||||
$layout2 = id(new AphrontMultiColumnView())
|
$layout2 = id(new AphrontMultiColumnView())
|
||||||
->addColumn($header1)
|
->addColumn($header1)
|
||||||
|
|
|
@ -2,58 +2,6 @@
|
||||||
|
|
||||||
final class CeleritySpriteGenerator {
|
final class CeleritySpriteGenerator {
|
||||||
|
|
||||||
public function buildMiniconsSheet() {
|
|
||||||
$icons = $this->getDirectoryList('minicons_white_1x');
|
|
||||||
|
|
||||||
$colors = array(
|
|
||||||
'white',
|
|
||||||
'dark',
|
|
||||||
);
|
|
||||||
|
|
||||||
$scales = array(
|
|
||||||
'1x' => 1,
|
|
||||||
'2x' => 2,
|
|
||||||
);
|
|
||||||
|
|
||||||
$template = id(new PhutilSprite())
|
|
||||||
->setSourceSize(16, 16);
|
|
||||||
|
|
||||||
$sprites = array();
|
|
||||||
foreach ($colors as $color) {
|
|
||||||
foreach ($icons as $icon) {
|
|
||||||
$prefix = 'minicons_';
|
|
||||||
if (strlen($color)) {
|
|
||||||
$prefix .= $color.'_';
|
|
||||||
}
|
|
||||||
|
|
||||||
$suffix = '';
|
|
||||||
if (strlen($color)) {
|
|
||||||
$suffix = '-'.$color;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sprite = id(clone $template)
|
|
||||||
->setName('minicons-'.$icon.$suffix);
|
|
||||||
|
|
||||||
$sprite->setTargetCSS('.minicons-'.$icon.$suffix);
|
|
||||||
|
|
||||||
foreach ($scales as $scale_key => $scale) {
|
|
||||||
$path = $this->getPath($prefix.$scale_key.'/'.$icon.'.png');
|
|
||||||
$sprite->setSourceFile($path, $scale);
|
|
||||||
}
|
|
||||||
$sprites[] = $sprite;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$sheet = $this->buildSheet('minicons', true);
|
|
||||||
$sheet->setScales($scales);
|
|
||||||
foreach ($sprites as $sprite) {
|
|
||||||
$sheet->addSprite($sprite);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $sheet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function buildMenuSheet() {
|
public function buildMenuSheet() {
|
||||||
$sprites = array();
|
$sprites = array();
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,8 @@ final class PHUIActionHeaderView extends AphrontView {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setHeaderIcon($minicon) {
|
public function setHeaderIcon(PHUIIconView $icon) {
|
||||||
$this->headerIcon = $minicon;
|
$this->headerIcon = $icon;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,13 +116,7 @@ final class PHUIActionHeaderView extends AphrontView {
|
||||||
|
|
||||||
$header_icon = null;
|
$header_icon = null;
|
||||||
if ($this->headerIcon) {
|
if ($this->headerIcon) {
|
||||||
require_celerity_resource('sprite-minicons-css');
|
$header_icon = $this->headerIcon;
|
||||||
$header_icon = phutil_tag(
|
|
||||||
'span',
|
|
||||||
array(
|
|
||||||
'class' => 'sprite-minicons minicons-'.$this->headerIcon
|
|
||||||
),
|
|
||||||
'');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$header_title = $this->headerTitle;
|
$header_title = $this->headerTitle;
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
final class PHUIIconView extends AphrontTagView {
|
final class PHUIIconView extends AphrontTagView {
|
||||||
|
|
||||||
const SPRITE_MINICONS = 'minicons';
|
|
||||||
const SPRITE_APPS = 'apps';
|
const SPRITE_APPS = 'apps';
|
||||||
const SPRITE_TOKENS = 'tokens';
|
const SPRITE_TOKENS = 'tokens';
|
||||||
const SPRITE_PAYMENTS = 'payments';
|
const SPRITE_PAYMENTS = 'payments';
|
||||||
|
|
|
@ -7,11 +7,6 @@
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phui-icon-view.sprite-minicons {
|
|
||||||
height: 16px;
|
|
||||||
width: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.phui-icon-view.sprite-apps {
|
.phui-icon-view.sprite-apps {
|
||||||
height: 14px;
|
height: 14px;
|
||||||
width: 14px;
|
width: 14px;
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
/**
|
|
||||||
* @provides sprite-minicons-css
|
|
||||||
* @generated
|
|
||||||
*/
|
|
||||||
|
|
||||||
.sprite-minicons {
|
|
||||||
background-image: url(/rsrc/image/sprite-minicons.png);
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media
|
|
||||||
only screen and (min-device-pixel-ratio: 1.5),
|
|
||||||
only screen and (-webkit-min-device-pixel-ratio: 1.5) {
|
|
||||||
.sprite-minicons {
|
|
||||||
background-image: url(/rsrc/image/sprite-minicons-X2.png);
|
|
||||||
background-size: 51px 51px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.minicons-company-white {
|
|
||||||
background-position: 0px 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.minicons-move-white {
|
|
||||||
background-position: -17px 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.minicons-public-white {
|
|
||||||
background-position: -34px 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.minicons-restricted-white {
|
|
||||||
background-position: 0px -17px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.minicons-company-dark {
|
|
||||||
background-position: -17px -17px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.minicons-move-dark {
|
|
||||||
background-position: -34px -17px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.minicons-public-dark {
|
|
||||||
background-position: 0px -34px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.minicons-restricted-dark {
|
|
||||||
background-position: -17px -34px;
|
|
||||||
}
|
|
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.8 KiB |