Skip to content

Commit 14dab3f

Browse files
committed
Convert ButtonBar to FontAwesome
Summary: Removes the sprites and images, uses fontawesome in examples and calendar Test Plan: UIExamples, Calendar {F163375} Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9371
1 parent d7ffe97 commit 14dab3f

File tree

12 files changed

+17
-157
lines changed

12 files changed

+17
-157
lines changed

resources/celerity/map.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
return array(
88
'names' =>
99
array(
10-
'core.pkg.css' => '2920014c',
10+
'core.pkg.css' => 'f16eaa39',
1111
'core.pkg.js' => '639b2433',
1212
'darkconsole.pkg.js' => 'ca8671ce',
1313
'differential.pkg.css' => '4a93db37',
@@ -124,14 +124,14 @@
124124
'rsrc/css/phui/calendar/phui-calendar-month.css' => 'a92e47d2',
125125
'rsrc/css/phui/calendar/phui-calendar.css' => '5e1ad989',
126126
'rsrc/css/phui/phui-box.css' => '7b3a2eed',
127-
'rsrc/css/phui/phui-button.css' => '45139eb8',
127+
'rsrc/css/phui/phui-button.css' => '1c771ff8',
128128
'rsrc/css/phui/phui-document.css' => '3b078dc0',
129129
'rsrc/css/phui/phui-feed-story.css' => 'e2c9bc83',
130130
'rsrc/css/phui/phui-fontkit.css' => 'de84aa4a',
131131
'rsrc/css/phui/phui-form-view.css' => 'ed856191',
132132
'rsrc/css/phui/phui-form.css' => 'b78ec020',
133133
'rsrc/css/phui/phui-header-view.css' => 'a2071a67',
134-
'rsrc/css/phui/phui-icon.css' => 'cdcf2aca',
134+
'rsrc/css/phui/phui-icon.css' => 'd8526aa1',
135135
'rsrc/css/phui/phui-info-panel.css' => '27ea50a1',
136136
'rsrc/css/phui/phui-list.css' => '43ed2d93',
137137
'rsrc/css/phui/phui-object-box.css' => 'ce92d8ec',
@@ -148,7 +148,6 @@
148148
'rsrc/css/phui/phui-workpanel-view.css' => 'fddd97bf',
149149
'rsrc/css/sprite-apps-large.css' => '12ea1ced',
150150
'rsrc/css/sprite-apps.css' => '37ee4f4e',
151-
'rsrc/css/sprite-buttonbar.css' => 'ba1c5738',
152151
'rsrc/css/sprite-conpherence.css' => '3b4a0487',
153152
'rsrc/css/sprite-docs.css' => '5f65d0da',
154153
'rsrc/css/sprite-gradient.css' => '4aec2401',
@@ -310,8 +309,6 @@
310309
'rsrc/image/sprite-apps-large.png' => '141d8c93',
311310
'rsrc/image/sprite-apps-xlarge.png' => 'a751a580',
312311
'rsrc/image/sprite-apps.png' => 'f6a0599f',
313-
'rsrc/image/sprite-buttonbar-X2.png' => '2c09a184',
314-
'rsrc/image/sprite-buttonbar.png' => 'e98e96af',
315312
'rsrc/image/sprite-conpherence-X2.png' => 'cd2d08d7',
316313
'rsrc/image/sprite-conpherence.png' => 'a5ab2eb7',
317314
'rsrc/image/sprite-docs-X2.png' => '6dc1adad',
@@ -752,7 +749,7 @@
752749
'phrequent-css' => 'ffc185ad',
753750
'phriction-document-css' => '7d7f0071',
754751
'phui-box-css' => '7b3a2eed',
755-
'phui-button-css' => '45139eb8',
752+
'phui-button-css' => '1c771ff8',
756753
'phui-calendar-css' => '5e1ad989',
757754
'phui-calendar-day-css' => 'de035c8a',
758755
'phui-calendar-list-css' => 'c1d0ca59',
@@ -764,7 +761,7 @@
764761
'phui-form-css' => 'b78ec020',
765762
'phui-form-view-css' => 'ed856191',
766763
'phui-header-view-css' => 'a2071a67',
767-
'phui-icon-view-css' => 'cdcf2aca',
764+
'phui-icon-view-css' => 'd8526aa1',
768765
'phui-info-panel-css' => '27ea50a1',
769766
'phui-list-view-css' => '43ed2d93',
770767
'phui-object-box-css' => 'ce92d8ec',
@@ -800,7 +797,6 @@
800797
'setup-issue-css' => '69e640e7',
801798
'sprite-apps-css' => '37ee4f4e',
802799
'sprite-apps-large-css' => '12ea1ced',
803-
'sprite-buttonbar-css' => 'ba1c5738',
804800
'sprite-conpherence-css' => '3b4a0487',
805801
'sprite-docs-css' => '5f65d0da',
806802
'sprite-gradient-css' => '4aec2401',

resources/sprite/manifest/buttonbar.json

Lines changed: 0 additions & 51 deletions
This file was deleted.

scripts/celerity/generate_sprites.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
'apps-large' => $generator->buildAppsLargeSheet(),
3636
'payments' => $generator->buildPaymentsSheet(),
3737
'tokens' => $generator->buildTokenSheet(),
38-
'buttonbar' => $generator->buildButtonBarSheet(),
3938
'docs' => $generator->buildDocsSheet(),
4039
'gradient' => $generator->buildGradientSheet(),
4140
'main-header' => $generator->buildMainHeaderSheet(),

src/applications/uiexample/examples/PHUIButtonBarExample.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ public function renderExample() {
1616

1717
// Icon Buttons
1818
$icons = array(
19-
'Go Back' => 'chevron-left',
20-
'Choose Date' => 'calendar',
21-
'Edit View' => 'pencil',
22-
'Go Forward' => 'chevron-right');
19+
'Go Back' => 'fa-chevron-left bluegrey',
20+
'Choose Date' => 'fa-calendar bluegrey',
21+
'Edit View' => 'fa-pencil bluegrey',
22+
'Go Forward' => 'fa-chevron-right bluegrey');
2323
$button_bar = new PHUIButtonBarView();
2424
foreach ($icons as $text => $icon) {
2525
$image = id(new PHUIIconView())
26-
->setSpriteSheet(PHUIIconView::SPRITE_BUTTONBAR)
27-
->setSpriteIcon($icon);
26+
->setIconFont($icon);
2827
$button = id(new PHUIButtonView())
2928
->setTag('a')
3029
->setColor(PHUIButtonView::GREY)

src/infrastructure/celerity/CeleritySpriteGenerator.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -268,38 +268,6 @@ public function buildTokenSheet() {
268268
return $sheet;
269269
}
270270

271-
public function buildButtonBarSheet() {
272-
$icons = $this->getDirectoryList('button_bar_1x');
273-
$scales = array(
274-
'1x' => 1,
275-
'2x' => 2,
276-
);
277-
$template = id(new PhutilSprite())
278-
->setSourceSize(14, 14);
279-
280-
$sprites = array();
281-
$prefix = 'button_bar_';
282-
foreach ($icons as $icon) {
283-
$sprite = id(clone $template)
284-
->setName('buttonbar-'.$icon)
285-
->setTargetCSS('.buttonbar-'.$icon);
286-
287-
foreach ($scales as $scale_key => $scale) {
288-
$path = $this->getPath($prefix.$scale_key.'/'.$icon.'.png');
289-
$sprite->setSourceFile($path, $scale);
290-
}
291-
$sprites[] = $sprite;
292-
}
293-
294-
$sheet = $this->buildSheet('buttonbar', true);
295-
$sheet->setScales($scales);
296-
foreach ($sprites as $sprite) {
297-
$sheet->addSprite($sprite);
298-
}
299-
300-
return $sheet;
301-
}
302-
303271
public function buildProjectsSheet() {
304272
$icons = $this->getDirectoryList('projects_1x');
305273
$scales = array(

src/view/phui/PHUIIconView.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ final class PHUIIconView extends AphrontTagView {
88
const SPRITE_PAYMENTS = 'payments';
99
const SPRITE_LOGIN = 'login';
1010
const SPRITE_PROJECTS = 'projects';
11-
const SPRITE_BUTTONBAR = 'buttonbar';
1211

1312
const HEAD_SMALL = 'phuihead-small';
1413
const HEAD_MEDIUM = 'phuihead-medium';

src/view/phui/calendar/PHUICalendarMonthView.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ private function renderCalendarHeader(DateTime $date) {
206206
$button_bar = new PHUIButtonBarView();
207207

208208
$left_icon = id(new PHUIIconView())
209-
->setSpriteSheet(PHUIIconView::SPRITE_BUTTONBAR)
210-
->setSpriteIcon('chevron-left');
209+
->setIconFont('fa-chevron-left bluegrey');
211210
$left = id(new PHUIButtonView())
212211
->setTag('a')
213212
->setColor(PHUIButtonView::GREY)
@@ -216,8 +215,7 @@ private function renderCalendarHeader(DateTime $date) {
216215
->setIcon($left_icon);
217216

218217
$right_icon = id(new PHUIIconView())
219-
->setSpriteSheet(PHUIIconView::SPRITE_BUTTONBAR)
220-
->setSpriteIcon('chevron-right');
218+
->setIconFont('fa-chevron-right bluegrey');
221219
$right = id(new PHUIButtonView())
222220
->setTag('a')
223221
->setColor(PHUIButtonView::GREY)

webroot/rsrc/css/phui/phui-button.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ a.toggle-fixed {
291291
left: 8px;
292292
}
293293

294+
.phui-button-bar .button .phui-icon-view {
295+
left: 11px;
296+
}
297+
294298
.button.has-icon .phui-button-text {
295299
margin-left: 16px;
296300
}

webroot/rsrc/css/phui/phui-icon.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
width: 16px;
1313
}
1414

15-
.phui-icon-view.sprite-apps,
16-
.phui-icon-view.sprite-buttonbar {
15+
.phui-icon-view.sprite-apps {
1716
height: 14px;
1817
width: 14px;
1918
}

webroot/rsrc/css/sprite-buttonbar.css

Lines changed: 0 additions & 51 deletions
This file was deleted.
-1.23 KB
Binary file not shown.
-489 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)