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

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

Issue 9465042: views: Add option in BoxLayout to spread blank space among the child views. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 22 matching lines...) Expand all
33 // Use |inside_border_horizontal_spacing| and 33 // Use |inside_border_horizontal_spacing| and
34 // |inside_border_vertical_spacing| to add additional space between the child 34 // |inside_border_vertical_spacing| to add additional space between the child
35 // view area and the host view border. |between_child_spacing| controls the 35 // view area and the host view border. |between_child_spacing| controls the
36 // space in between child views. 36 // space in between child views.
37 BoxLayout(Orientation orientation, 37 BoxLayout(Orientation orientation,
38 int inside_border_horizontal_spacing, 38 int inside_border_horizontal_spacing,
39 int inside_border_vertical_spacing, 39 int inside_border_vertical_spacing,
40 int between_child_spacing); 40 int between_child_spacing);
41 virtual ~BoxLayout(); 41 virtual ~BoxLayout();
42 42
43 void set_spread_blank_space(bool spread) {
44 spread_blank_space_ = spread;
45 }
46
43 // Overridden from views::LayoutManager: 47 // Overridden from views::LayoutManager:
44 virtual void Layout(View* host) OVERRIDE; 48 virtual void Layout(View* host) OVERRIDE;
45 virtual gfx::Size GetPreferredSize(View* host) OVERRIDE; 49 virtual gfx::Size GetPreferredSize(View* host) OVERRIDE;
46 50
47 private: 51 private:
48 const Orientation orientation_; 52 const Orientation orientation_;
49 53
50 // Spacing between child views and host view border. 54 // Spacing between child views and host view border.
51 const int inside_border_horizontal_spacing_; 55 const int inside_border_horizontal_spacing_;
52 const int inside_border_vertical_spacing_; 56 const int inside_border_vertical_spacing_;
53 57
54 // Spacing to put in between child views. 58 // Spacing to put in between child views.
55 const int between_child_spacing_; 59 const int between_child_spacing_;
56 60
61 // Whether the available extra space should be distributed among the child
62 // views.
63 bool spread_blank_space_;
64
57 DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout); 65 DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout);
58 }; 66 };
59 67
60 } // namespace views 68 } // namespace views
61 69
62 #endif // UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ 70 #endif // UI_VIEWS_LAYOUT_BOX_LAYOUT_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/layout/box_layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698