Skip to content

Commit e81ec73

Browse files
committed
[Redesign] Add back limited header-color options
Summary: Ref T8099. Adds back basic header color options, which change the logo color instead. Also RAINBOW. Test Plan: tested each of the new colors. {F442284} Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8099 Differential Revision: https://secure.phabricator.com/D13040
1 parent b24260b commit e81ec73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+137
-186
lines changed

resources/celerity/map.php

+5-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
return array(
99
'names' => array(
10-
'core.pkg.css' => 'e5517713',
10+
'core.pkg.css' => '75121d30',
1111
'core.pkg.js' => '9db3e620',
1212
'darkconsole.pkg.js' => 'e7393ebb',
1313
'differential.pkg.css' => 'bb338e4b',
@@ -153,8 +153,7 @@
153153
'rsrc/css/phui/phui-workboard-view.css' => '720efdde',
154154
'rsrc/css/phui/phui-workpanel-view.css' => '015a0cab',
155155
'rsrc/css/sprite-login.css' => 'a3526809',
156-
'rsrc/css/sprite-main-header.css' => '28d01b0b',
157-
'rsrc/css/sprite-menu.css' => '02aa815a',
156+
'rsrc/css/sprite-menu.css' => 'ab8f6356',
158157
'rsrc/css/sprite-projects.css' => 'b0d9e24f',
159158
'rsrc/css/sprite-tokens.css' => '1706b943',
160159
'rsrc/externals/font/fontawesome/fontawesome-webfont.eot' => '5fb6fb0e',
@@ -305,9 +304,8 @@
305304
'rsrc/image/phrequent_inactive.png' => 'bfc15a69',
306305
'rsrc/image/sprite-login-X2.png' => 'a15918f0',
307306
'rsrc/image/sprite-login.png' => '8cee4f6e',
308-
'rsrc/image/sprite-main-header.png' => '39419fa6',
309-
'rsrc/image/sprite-menu-X2.png' => 'e8655658',
310-
'rsrc/image/sprite-menu.png' => 'e7e02f73',
307+
'rsrc/image/sprite-menu-X2.png' => 'dc41efa4',
308+
'rsrc/image/sprite-menu.png' => '8848c09a',
311309
'rsrc/image/sprite-projects-X2.png' => '8c91c839',
312310
'rsrc/image/sprite-projects.png' => 'ef9dc9b5',
313311
'rsrc/image/sprite-tokens-X2.png' => 'b4776580',
@@ -808,8 +806,7 @@
808806
'releeph-request-typeahead-css' => '667a48ae',
809807
'setup-issue-css' => '631c4e92',
810808
'sprite-login-css' => 'a3526809',
811-
'sprite-main-header-css' => '28d01b0b',
812-
'sprite-menu-css' => '02aa815a',
809+
'sprite-menu-css' => 'ab8f6356',
813810
'sprite-projects-css' => 'b0d9e24f',
814811
'sprite-tokens-css' => '1706b943',
815812
'syntax-highlighting-css' => '6b7b24d9',
@@ -2070,7 +2067,6 @@
20702067
'phui-list-view-css',
20712068
'font-fontawesome',
20722069
'phui-font-icon-base-css',
2073-
'sprite-main-header-css',
20742070
'phui-box-css',
20752071
'phui-object-box-css',
20762072
'phui-timeline-view-css',

resources/celerity/packages.php

-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@
125125

126126
'font-fontawesome',
127127
'phui-font-icon-base-css',
128-
'sprite-main-header-css',
129128
'phui-box-css',
130129
'phui-object-box-css',
131130
'phui-timeline-view-css',
-174 Bytes
Binary file not shown.
-1.16 KB
Binary file not shown.

resources/sprite/main_header/blue.png

-401 Bytes
Binary file not shown.

resources/sprite/main_header/dark.png

-423 Bytes
Binary file not shown.
-171 Bytes
Binary file not shown.
-432 Bytes
Binary file not shown.
-943 Bytes
Binary file not shown.
-269 Bytes
Binary file not shown.

resources/sprite/main_header/red.png

-406 Bytes
Binary file not shown.
-153 Bytes
Binary file not shown.
-421 Bytes
Binary file not shown.

resources/sprite/manifest/main-header.json

-65
This file was deleted.

resources/sprite/manifest/menu.json

+59-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,65 @@
11
{
22
"version": 1,
33
"sprites": {
4-
"eye": {
5-
"name": "eye",
6-
"rule": ".phabricator-main-menu-eye",
7-
"hash": "8848ce0f1d60278ba13a306805107d62"
8-
},
9-
"logo": {
10-
"name": "logo",
11-
"rule": ".phabricator-main-menu-logo",
12-
"hash": "346032db9e1dbaafc9574664b9581b03"
4+
"blindigo-eye": {
5+
"name": "blindigo-eye",
6+
"rule": ".blindigo-eye",
7+
"hash": "fcd3eb2a8d2d8babf59a952b62783282"
8+
},
9+
"blindigo-logo": {
10+
"name": "blindigo-logo",
11+
"rule": ".blindigo-logo",
12+
"hash": "a22978e621df5126471576510303222f"
13+
},
14+
"blue-eye": {
15+
"name": "blue-eye",
16+
"rule": ".blue-eye",
17+
"hash": "f7505e56e452c5922f1a275a736d5326"
18+
},
19+
"blue-logo": {
20+
"name": "blue-logo",
21+
"rule": ".blue-logo",
22+
"hash": "4c6240f153245d56a6bf02bb6796404f"
23+
},
24+
"dark-eye": {
25+
"name": "dark-eye",
26+
"rule": ".dark-eye",
27+
"hash": "c8112e52666fa1cb509ebb2cdf3a3df5"
28+
},
29+
"dark-logo": {
30+
"name": "dark-logo",
31+
"rule": ".dark-logo",
32+
"hash": "e3425da87e8f6737d8db0063d064cd7d"
33+
},
34+
"indigo-eye": {
35+
"name": "indigo-eye",
36+
"rule": ".indigo-eye",
37+
"hash": "497b57bc1709a88fa68b14dc88a2a253"
38+
},
39+
"indigo-logo": {
40+
"name": "indigo-logo",
41+
"rule": ".indigo-logo",
42+
"hash": "c7223567a77c46fbab571170f0a76ae6"
43+
},
44+
"rainbow-eye": {
45+
"name": "rainbow-eye",
46+
"rule": ".rainbow-eye",
47+
"hash": "2c63171eeb8ba6acb645219fdf2585b1"
48+
},
49+
"rainbow-logo": {
50+
"name": "rainbow-logo",
51+
"rule": ".rainbow-logo",
52+
"hash": "eca0c685cb9524bff513a5f7eab7c6e5"
53+
},
54+
"red-eye": {
55+
"name": "red-eye",
56+
"rule": ".red-eye",
57+
"hash": "97a9a11ecbeee1fbb8a7c8ea406e4be4"
58+
},
59+
"red-logo": {
60+
"name": "red-logo",
61+
"rule": ".red-logo",
62+
"hash": "1126a79154d24242d3f72e868b95a445"
1363
}
1464
},
1565
"scales": [
2 KB
1.37 KB

resources/sprite/menu_1x/blue-eye.png

2 KB
1.37 KB
2 KB
1.37 KB
2.42 KB
2.45 KB

resources/sprite/menu_1x/red-eye.png

2 KB

resources/sprite/menu_1x/red-logo.png

1.37 KB
3.42 KB
1.72 KB

resources/sprite/menu_2x/blue-eye.png

3.41 KB
1.72 KB
3.42 KB
1.72 KB
4.81 KB
5.3 KB

resources/sprite/menu_2x/red-eye.png

3.36 KB

resources/sprite/menu_2x/red-logo.png

1.71 KB

scripts/celerity/generate_sprites.php

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
$sheets = array(
3030
'menu' => $generator->buildMenuSheet(),
3131
'tokens' => $generator->buildTokenSheet(),
32-
'main-header' => $generator->buildMainHeaderSheet(),
3332
'login' => $generator->buildLoginSheet(),
3433
'projects' => $generator->buildProjectsSheet(),
3534
);

src/applications/celerity/CeleritySpriteGenerator.php

+18-34
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,28 @@ final class CeleritySpriteGenerator {
55
public function buildMenuSheet() {
66
$sprites = array();
77

8-
$sources = array(
9-
'logo' => array(
8+
$colors = array(
9+
'dark',
10+
'red',
11+
'blue',
12+
'indigo',
13+
'blindigo',
14+
'rainbow',
15+
);
16+
17+
$sources = array();
18+
foreach ($colors as $color) {
19+
$sources[$color.'-logo'] = array(
1020
'x' => 96,
1121
'y' => 40,
12-
'css' => '.phabricator-main-menu-logo',
13-
),
14-
'eye' => array(
22+
'css' => '.'.$color.'-logo',
23+
);
24+
$sources[$color.'-eye'] = array(
1525
'x' => 40,
1626
'y' => 40,
17-
'css' => '.phabricator-main-menu-eye',
18-
),
19-
);
27+
'css' => '.'.$color.'-eye',
28+
);
29+
}
2030

2131
$scales = array(
2232
'1x' => 1,
@@ -144,32 +154,6 @@ public function buildLoginSheet() {
144154
return $sheet;
145155
}
146156

147-
public function buildMainHeaderSheet() {
148-
$gradients = $this->getDirectoryList('main_header');
149-
$template = new PhutilSprite();
150-
151-
$sprites = array();
152-
foreach ($gradients as $gradient) {
153-
$path = $this->getPath('main_header/'.$gradient.'.png');
154-
$sprite = id(clone $template)
155-
->setName('main-header-'.$gradient)
156-
->setSourceFile($path)
157-
->setTargetCSS('.main-header-'.$gradient);
158-
$sprite->setSourceSize(6, 44);
159-
$sprites[] = $sprite;
160-
}
161-
162-
$sheet = $this->buildSheet('main-header',
163-
false,
164-
PhutilSpriteSheet::TYPE_REPEAT_X);
165-
166-
foreach ($sprites as $sprite) {
167-
$sheet->addSprite($sprite);
168-
}
169-
170-
return $sheet;
171-
}
172-
173157
private function getPath($to_path = null) {
174158
$root = dirname(phutil_get_library_root('phabricator'));
175159
return $root.'/resources/sprite/'.$to_path;

src/applications/config/option/PhabricatorUIConfigOptions.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@ public function getGroup() {
2020
}
2121

2222
public function getOptions() {
23-
$manifest = PHUIIconView::getSheetManifest('main-header');
2423
$custom_header_example =
2524
PhabricatorCustomHeaderConfigType::getExampleConfig();
2625
$experimental_link = 'https://secure.phabricator.com/T4214';
2726

28-
$options = array();
29-
foreach (array_keys($manifest) as $sprite_name) {
30-
$key = substr($sprite_name, strlen('main-header-'));
31-
$options[$key] = $key;
32-
}
27+
$options = array(
28+
'blindigo' => 'blindigo',
29+
'blue' => 'blue',
30+
'dark' => 'dark',
31+
'indigo' => 'indigo',
32+
'red' => 'red',
33+
'rainbow' => 'rainbow',
34+
);
3335

3436
$example = <<<EOJSON
3537
[

src/view/page/menu/PhabricatorMainMenuView.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ private function renderPhabricatorLogo() {
275275
}
276276
}
277277

278+
$color = PhabricatorEnv::getEnvConfig('ui.header-color');
279+
278280
return phutil_tag(
279281
'a',
280282
array(
@@ -291,13 +293,13 @@ private function renderPhabricatorLogo() {
291293
phutil_tag(
292294
'span',
293295
array(
294-
'class' => 'sprite-menu phabricator-main-menu-eye',
296+
'class' => 'sprite-menu phabricator-main-menu-eye '.$color.'-eye',
295297
),
296298
''),
297299
phutil_tag(
298300
'span',
299301
array(
300-
'class' => 'sprite-menu phabricator-main-menu-logo',
302+
'class' => 'sprite-menu phabricator-main-menu-logo '.$color.'-logo',
301303
'style' => $style_logo,
302304
),
303305
''),

webroot/rsrc/css/sprite-main-header.css

-56
This file was deleted.

0 commit comments

Comments
 (0)