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

Side by Side Diff: ui/views/layout/box_layout.h

Issue 310753002: Add ability to set the border insets of a box layout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/views/layout/box_layout_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ 5 #ifndef UI_VIEWS_LAYOUT_BOX_LAYOUT_H_
6 #define UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ 6 #define UI_VIEWS_LAYOUT_BOX_LAYOUT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "ui/gfx/insets.h" 10 #include "ui/gfx/insets.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 BoxLayout(Orientation orientation, 57 BoxLayout(Orientation orientation,
58 int inside_border_horizontal_spacing, 58 int inside_border_horizontal_spacing,
59 int inside_border_vertical_spacing, 59 int inside_border_vertical_spacing,
60 int between_child_spacing); 60 int between_child_spacing);
61 virtual ~BoxLayout(); 61 virtual ~BoxLayout();
62 62
63 void set_main_axis_alignment(MainAxisAlignment main_axis_alignment) { 63 void set_main_axis_alignment(MainAxisAlignment main_axis_alignment) {
64 main_axis_alignment_ = main_axis_alignment; 64 main_axis_alignment_ = main_axis_alignment;
65 } 65 }
66 66
67 void set_inside_border_insets(const gfx::Insets& insets) {
68 inside_border_insets_ = insets;
69 }
70
67 // Overridden from views::LayoutManager: 71 // Overridden from views::LayoutManager:
68 virtual void Layout(View* host) OVERRIDE; 72 virtual void Layout(View* host) OVERRIDE;
69 virtual gfx::Size GetPreferredSize(const View* host) const OVERRIDE; 73 virtual gfx::Size GetPreferredSize(const View* host) const OVERRIDE;
70 virtual int GetPreferredHeightForWidth(const View* host, 74 virtual int GetPreferredHeightForWidth(const View* host,
71 int width) const OVERRIDE; 75 int width) const OVERRIDE;
72 76
73 private: 77 private:
74 // Returns the size and position along the main axis of |child_area|. 78 // Returns the size and position along the main axis of |child_area|.
75 int MainAxisSize(const gfx::Rect& child_area) const; 79 int MainAxisSize(const gfx::Rect& child_area) const;
76 int MainAxisPosition(const gfx::Rect& child_area) const; 80 int MainAxisPosition(const gfx::Rect& child_area) const;
(...skipping 21 matching lines...) Expand all
98 // The alignment of children in the main axis. This is 102 // The alignment of children in the main axis. This is
99 // MAIN_AXIS_ALIGNMENT_START by default. 103 // MAIN_AXIS_ALIGNMENT_START by default.
100 MainAxisAlignment main_axis_alignment_; 104 MainAxisAlignment main_axis_alignment_;
101 105
102 DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout); 106 DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout);
103 }; 107 };
104 108
105 } // namespace views 109 } // namespace views
106 110
107 #endif // UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ 111 #endif // UI_VIEWS_LAYOUT_BOX_LAYOUT_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/layout/box_layout_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698