Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: ui/views/examples/button_example.cc

Issue 1573573003: Add MdTextButton to Views examples sandbox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/button_example.cc
diff --git a/ui/views/examples/button_example.cc b/ui/views/examples/button_example.cc
index b053c76aaea40a498bfea757ff3fa32a729fe26e..20c3ff5e90887b356b9abbaa898e54a931ab110a 100644
--- a/ui/views/examples/button_example.cc
+++ b/ui/views/examples/button_example.cc
@@ -12,6 +12,7 @@
#include "ui/views/controls/button/blue_button.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/button/label_button.h"
+#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/resources/grit/views_resources.h"
#include "ui/views/view.h"
@@ -44,7 +45,9 @@ ButtonExample::~ButtonExample() {
void ButtonExample::CreateExampleView(View* container) {
container->set_background(Background::CreateSolidBackground(SK_ColorWHITE));
- container->SetLayoutManager(new BoxLayout(BoxLayout::kVertical, 10, 10, 10));
+ BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, 10, 10, 10);
+ layout->set_cross_axis_alignment(BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
+ container->SetLayoutManager(layout);
label_button_ = new LabelButton(this, ASCIIToUTF16(kLabelButton));
label_button_->SetFocusable(true);
@@ -63,6 +66,9 @@ void ButtonExample::CreateExampleView(View* container) {
container->AddChildView(new BlueButton(this, ASCIIToUTF16("Blue Button")));
+ container->AddChildView(
+ new MdTextButton(nullptr, base::ASCIIToUTF16("Material design")));
+
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
image_button_ = new ImageButton(this);
image_button_->SetFocusable(true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698