OLD | NEW |
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/views/layout/layout_manager.h" | 11 #include "ui/views/layout/layout_manager.h" |
11 | 12 |
12 namespace gfx { | 13 namespace gfx { |
13 class Size; | 14 class Size; |
14 } | 15 } |
15 | 16 |
16 namespace views { | 17 namespace views { |
17 | 18 |
18 class View; | 19 class View; |
19 | 20 |
(...skipping 19 matching lines...) Expand all Loading... |
39 int between_child_spacing); | 40 int between_child_spacing); |
40 virtual ~BoxLayout(); | 41 virtual ~BoxLayout(); |
41 | 42 |
42 void set_spread_blank_space(bool spread) { | 43 void set_spread_blank_space(bool spread) { |
43 spread_blank_space_ = spread; | 44 spread_blank_space_ = spread; |
44 } | 45 } |
45 | 46 |
46 // Overridden from views::LayoutManager: | 47 // Overridden from views::LayoutManager: |
47 virtual void Layout(View* host) OVERRIDE; | 48 virtual void Layout(View* host) OVERRIDE; |
48 virtual gfx::Size GetPreferredSize(View* host) OVERRIDE; | 49 virtual gfx::Size GetPreferredSize(View* host) OVERRIDE; |
| 50 virtual int GetPreferredHeightForWidth(View* host, int width) OVERRIDE; |
49 | 51 |
50 private: | 52 private: |
| 53 // The preferred size for the dialog given the width of the child area. |
| 54 gfx::Size GetPreferredSizeForChildWidth(View* host, int child_area_width); |
| 55 |
| 56 // The amount of space the layout requires in addition to any space for the |
| 57 // child views. |
| 58 gfx::Size NonChildSize(View* host); |
| 59 |
51 const Orientation orientation_; | 60 const Orientation orientation_; |
52 | 61 |
53 // Spacing between child views and host view border. | 62 // Spacing between child views and host view border. |
54 const int inside_border_horizontal_spacing_; | 63 gfx::Insets inside_border_insets_; |
55 const int inside_border_vertical_spacing_; | |
56 | 64 |
57 // Spacing to put in between child views. | 65 // Spacing to put in between child views. |
58 const int between_child_spacing_; | 66 const int between_child_spacing_; |
59 | 67 |
60 // Whether the available extra space should be distributed among the child | 68 // Whether the available extra space should be distributed among the child |
61 // views. | 69 // views. |
62 bool spread_blank_space_; | 70 bool spread_blank_space_; |
63 | 71 |
64 DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout); | 72 DISALLOW_IMPLICIT_CONSTRUCTORS(BoxLayout); |
65 }; | 73 }; |
66 | 74 |
67 } // namespace views | 75 } // namespace views |
68 | 76 |
69 #endif // UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ | 77 #endif // UI_VIEWS_LAYOUT_BOX_LAYOUT_H_ |
OLD | NEW |