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

Unified Diff: ui/views/layout/box_layout.h

Issue 284753002: Add main axis alignment for BoxLayout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | ui/views/layout/box_layout.cc » ('j') | ui/views/layout/box_layout.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/layout/box_layout.h
diff --git a/ui/views/layout/box_layout.h b/ui/views/layout/box_layout.h
index 7670d8cb05e7bd15b59771b2e95c3ade65aabf84..65fdbe05583968fcefa5bf74330494206877318c 100644
--- a/ui/views/layout/box_layout.h
+++ b/ui/views/layout/box_layout.h
@@ -30,6 +30,12 @@ class VIEWS_EXPORT BoxLayout : public LayoutManager {
kVertical,
};
+ enum BoxPack {
+ BOX_PACK_START,
+ BOX_PACK_CENTER,
+ BOX_PACK_END,
+ };
+
// Use |inside_border_horizontal_spacing| and
// |inside_border_vertical_spacing| to add additional space between the child
// view area and the host view border. |between_child_spacing| controls the
@@ -44,6 +50,8 @@ class VIEWS_EXPORT BoxLayout : public LayoutManager {
spread_blank_space_ = spread;
}
+ void set_box_pack(BoxPack box_pack) { box_pack_ = box_pack; }
benwells 2014/05/13 02:48:05 Comment what this is, and mention what the default
calamity 2014/05/13 04:29:29 Is the member comment not enough?
+
// Overridden from views::LayoutManager:
virtual void Layout(View* host) OVERRIDE;
virtual gfx::Size GetPreferredSize(View* host) OVERRIDE;
@@ -69,6 +77,9 @@ class VIEWS_EXPORT BoxLayout : public LayoutManager {
// views.
bool spread_blank_space_;
+ // The alignment of children in the main axis.
+ BoxPack box_pack_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout);
};
« no previous file with comments | « no previous file | ui/views/layout/box_layout.cc » ('j') | ui/views/layout/box_layout.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698