Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13979105
D18048.id43406.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D18048.id43406.diff
View Options
diff --git a/src/applications/auth/controller/config/PhabricatorAuthListController.php b/src/applications/auth/controller/config/PhabricatorAuthListController.php
--- a/src/applications/auth/controller/config/PhabricatorAuthListController.php
+++ b/src/applications/auth/controller/config/PhabricatorAuthListController.php
@@ -103,7 +103,7 @@
$button = id(new PHUIButtonView())
->setTag('a')
- ->setColor(PHUIButtonView::SIMPLE)
+ ->setDesign(PHUIButtonView::DESIGN_SIMPLE)
->setHref($this->getApplicationURI('config/new/'))
->setIcon('fa-plus')
->setDisabled(!$can_manage)
diff --git a/src/applications/guides/view/PhabricatorGuideListView.php b/src/applications/guides/view/PhabricatorGuideListView.php
--- a/src/applications/guides/view/PhabricatorGuideListView.php
+++ b/src/applications/guides/view/PhabricatorGuideListView.php
@@ -30,7 +30,7 @@
->setText(pht('Skip'))
->setTag('a')
->setHref($skip_href)
- ->setColor(PHUIButtonView::SIMPLE);
+ ->setDesign(PHUIButtonView::DESIGN_SIMPLE);
$list_item->setSideColumn($skip);
}
$list->addItem($list_item);
diff --git a/src/applications/phame/query/PhameBlogSearchEngine.php b/src/applications/phame/query/PhameBlogSearchEngine.php
--- a/src/applications/phame/query/PhameBlogSearchEngine.php
+++ b/src/applications/phame/query/PhameBlogSearchEngine.php
@@ -98,7 +98,7 @@
->setTag('a')
->setText('New Post')
->setHref($this->getApplicationURI('/post/edit/?blog='.$id))
- ->setColor(PHUIButtonView::SIMPLE);
+ ->setDesign(PHUIButtonView::DESIGN_SIMPLE);
$item->setSideColumn($button);
}
diff --git a/src/applications/uiexample/examples/PHUIBoxExample.php b/src/applications/uiexample/examples/PHUIBoxExample.php
--- a/src/applications/uiexample/examples/PHUIBoxExample.php
+++ b/src/applications/uiexample/examples/PHUIBoxExample.php
@@ -62,11 +62,11 @@
);
$button = id(new PHUIButtonView())
- ->setTag('a')
- ->setColor(PHUIButtonView::SIMPLE)
- ->setIcon('fa-heart')
- ->setText(pht('Such Wow'))
- ->addClass(PHUI::MARGIN_SMALL_RIGHT);
+ ->setTag('a')
+ ->setDesign(PHUIButtonView::DESIGN_SIMPLE)
+ ->setIcon('fa-heart')
+ ->setText(pht('Such Wow'))
+ ->addClass(PHUI::MARGIN_SMALL_RIGHT);
$badge1 = id(new PHUIBadgeMiniView())
->setIcon('fa-bug')
diff --git a/src/applications/uiexample/examples/PHUIButtonBarExample.php b/src/applications/uiexample/examples/PHUIButtonBarExample.php
--- a/src/applications/uiexample/examples/PHUIButtonBarExample.php
+++ b/src/applications/uiexample/examples/PHUIButtonBarExample.php
@@ -36,7 +36,7 @@
foreach ($icons as $text => $icon) {
$button = id(new PHUIButtonView())
->setTag('a')
- ->setColor(PHUIButtonView::SIMPLE)
+ ->setDesign(PHUIButtonView::DESIGN_SIMPLE)
->setTitle($text)
->setText($text);
@@ -47,7 +47,7 @@
foreach ($icons as $text => $icon) {
$button = id(new PHUIButtonView())
->setTag('a')
- ->setColor(PHUIButtonView::SIMPLE)
+ ->setDesign(PHUIButtonView::DESIGN_SIMPLE)
->setTitle($text)
->setTooltip($text)
->setIcon($icon);
diff --git a/src/applications/uiexample/examples/PHUIButtonExample.php b/src/applications/uiexample/examples/PHUIButtonExample.php
--- a/src/applications/uiexample/examples/PHUIButtonExample.php
+++ b/src/applications/uiexample/examples/PHUIButtonExample.php
@@ -129,15 +129,15 @@
'Subscribe' => 'fa-check-circle bluegrey',
'Edit' => 'fa-pencil bluegrey',
);
- $colors = array(
- PHUIButtonView::SIMPLE,
+ $designs = array(
+ PHUIButtonView::DESIGN_SIMPLE,
);
$column = array();
- foreach ($colors as $color) {
+ foreach ($designs as $design) {
foreach ($icons as $text => $icon) {
$column[] = id(new PHUIButtonView())
->setTag('a')
- ->setColor($color)
+ ->setDesign($design)
->setIcon($icon)
->setText($text)
->addClass(PHUI::MARGIN_SMALL_RIGHT);
diff --git a/src/view/phui/PHUIButtonView.php b/src/view/phui/PHUIButtonView.php
--- a/src/view/phui/PHUIButtonView.php
+++ b/src/view/phui/PHUIButtonView.php
@@ -10,6 +10,9 @@
const SMALL = 'small';
const BIG = 'big';
+ const DESIGN_DEFAULT = 'design.default';
+ const DESIGN_SIMPLE = 'design.simple';
+
private $size;
private $text;
private $subtext;
@@ -25,6 +28,7 @@
private $tooltip;
private $noCSS;
private $hasCaret;
+ private $design = self::DESIGN_DEFAULT;
public function setName($name) {
$this->name = $name;
@@ -103,6 +107,15 @@
return $this->hasCaret;
}
+ public function setDesign($design) {
+ $this->design = $design;
+ return $this;
+ }
+
+ public function getDesign() {
+ return $this->design;
+ }
+
public function setIcon($icon, $first = true) {
if (!($icon instanceof PHUIIconView)) {
$icon = id(new PHUIIconView())
@@ -169,6 +182,15 @@
$classes[] = 'disabled';
}
+ switch ($this->getDesign()) {
+ case self::DESIGN_DEFAULT:
+ // Nothing special for default buttons.
+ break;
+ case self::DESIGN_SIMPLE:
+ $classes[] = 'simple';
+ break;
+ }
+
$sigil = null;
$meta = null;
if ($this->tooltip) {
diff --git a/src/view/phui/PHUIDocumentViewPro.php b/src/view/phui/PHUIDocumentViewPro.php
--- a/src/view/phui/PHUIDocumentViewPro.php
+++ b/src/view/phui/PHUIDocumentViewPro.php
@@ -79,7 +79,7 @@
$toc[] = id(new PHUIButtonView())
->setTag('a')
->setIcon('fa-align-left')
- ->setColor(PHUIButtonView::SIMPLE)
+ ->setDesign(PHUIButtonView::DESIGN_SIMPLE)
->addClass('phui-document-toc')
->addSigil('jx-toggle-class')
->setMetaData(array(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 20, 2:42 AM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6734808
Default Alt Text
D18048.id43406.diff (5 KB)
Attached To
Mode
D18048: Make "simple" a "button type", not a "color"
Attached
Detach File
Event Timeline
Log In to Comment