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

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

Issue 2316073002: views_examples: use fixed widths for button sticker sheet (Closed)
Patch Set: Created 4 years, 3 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_sticker_sheet.cc
diff --git a/ui/views/examples/button_sticker_sheet.cc b/ui/views/examples/button_sticker_sheet.cc
index 6f292a784d1634eda799be4f3e8c985574de9183..922cc986b04cb63d6bb5b7709ded4ca8f4e4b0ed 100644
--- a/ui/views/examples/button_sticker_sheet.cc
+++ b/ui/views/examples/button_sticker_sheet.cc
@@ -23,21 +23,22 @@ const int kStretchyGridColumnSetId = 0;
// weight and will flex in either dimension as needed. The resulting grid layout
// has only one ColumnSet (numbered kStretchyGridColumnSetId).
GridLayout* MakeStretchyGridLayout(View* host, int ncols) {
- const float kPaddingDoesNotResize = 0.0;
- const int kPaddingWidth = 8;
+ const float kPaddingResizesEqually = 1.0;
+ const int kPaddingWidth = 30;
const GridLayout::Alignment kColumnStretchesHorizontally = GridLayout::FILL;
const GridLayout::Alignment kColumnStretchesVertically = GridLayout::FILL;
- const float kColumnResizesEqually = 1.0;
- const GridLayout::SizeType kColumnUsesPreferredSize = GridLayout::USE_PREF;
+ const float kColumnDoesNotResize = 0.0;
+ const GridLayout::SizeType kColumnUsesFixedSize = GridLayout::FIXED;
+ const int kColumnWidth = 96;
GridLayout* layout = new GridLayout(host);
ColumnSet* columns = layout->AddColumnSet(kStretchyGridColumnSetId);
for (int i = 0; i < ncols; ++i) {
if (i != 0)
- columns->AddPaddingColumn(kPaddingDoesNotResize, kPaddingWidth);
+ columns->AddPaddingColumn(kPaddingResizesEqually, kPaddingWidth);
columns->AddColumn(kColumnStretchesHorizontally, kColumnStretchesVertically,
- kColumnResizesEqually, kColumnUsesPreferredSize, 0,
- 0); // These two are ignored when using PREF.
+ kColumnDoesNotResize, kColumnUsesFixedSize, kColumnWidth,
+ kColumnWidth);
}
return layout;
}
« 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