OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 VIEWS_CONTROLS_MENU_MENU_CONFIG_H_ | 5 #ifndef VIEWS_CONTROLS_MENU_MENU_CONFIG_H_ |
6 #define VIEWS_CONTROLS_MENU_MENU_CONFIG_H_ | 6 #define VIEWS_CONTROLS_MENU_MENU_CONFIG_H_ |
7 | 7 |
8 #include "gfx/font.h" | 8 #include "gfx/font.h" |
9 | 9 |
10 namespace views { | 10 namespace views { |
11 | 11 |
12 // Layout type information for menu items. Use the instance() method to obtain | 12 // Layout type information for menu items. Use the instance() method to obtain |
13 // the MenuConfig for the current platform. | 13 // the MenuConfig for the current platform. |
14 struct MenuConfig { | 14 struct MenuConfig { |
15 MenuConfig() : item_top_margin(3), | 15 MenuConfig() |
16 item_bottom_margin(4), | 16 : item_top_margin(3), |
17 item_no_icon_top_margin(1), | 17 item_bottom_margin(4), |
18 item_no_icon_bottom_margin(3), | 18 item_no_icon_top_margin(1), |
19 item_left_margin(4), | 19 item_no_icon_bottom_margin(3), |
20 label_to_arrow_padding(10), | 20 item_left_margin(4), |
21 arrow_to_edge_padding(5), | 21 label_to_arrow_padding(10), |
22 icon_to_label_padding(8), | 22 arrow_to_edge_padding(5), |
23 gutter_to_label(5), | 23 icon_to_label_padding(8), |
24 check_width(16), | 24 gutter_to_label(5), |
25 check_height(16), | 25 check_width(16), |
26 arrow_height(9), | 26 check_height(16), |
27 arrow_width(9), | 27 arrow_height(9), |
28 gutter_width(0), | 28 arrow_width(9), |
29 separator_height(6), | 29 gutter_width(0), |
30 render_gutter(false), | 30 separator_height(6), |
31 show_mnemonics(false), | 31 render_gutter(false), |
32 scroll_arrow_height(3) { | 32 show_mnemonics(false), |
| 33 scroll_arrow_height(3), |
| 34 label_to_accelerator_padding(10) { |
33 } | 35 } |
34 | 36 |
35 // Resets the single shared MenuConfig instance. The next time instance() is | 37 // Resets the single shared MenuConfig instance. The next time instance() is |
36 // invoked a new MenuConfig is created and configured. | 38 // invoked a new MenuConfig is created and configured. |
37 static void Reset(); | 39 static void Reset(); |
38 | 40 |
39 // Returns the single shared MenuConfig instance, creating if necessary. | 41 // Returns the single shared MenuConfig instance, creating if necessary. |
40 static const MenuConfig& instance(); | 42 static const MenuConfig& instance(); |
41 | 43 |
42 // Font used by menus. | 44 // Font used by menus. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Whether or not the gutter should be rendered. The gutter is specific to | 89 // Whether or not the gutter should be rendered. The gutter is specific to |
88 // Vista. | 90 // Vista. |
89 bool render_gutter; | 91 bool render_gutter; |
90 | 92 |
91 // Are mnemonics shown? | 93 // Are mnemonics shown? |
92 bool show_mnemonics; | 94 bool show_mnemonics; |
93 | 95 |
94 // Height of the scroll arrow. | 96 // Height of the scroll arrow. |
95 int scroll_arrow_height; | 97 int scroll_arrow_height; |
96 | 98 |
| 99 // Padding between the label and accelerator. Only used if there is an |
| 100 // accelerator. |
| 101 int label_to_accelerator_padding; |
| 102 |
97 private: | 103 private: |
98 // Creates and configures a new MenuConfig as appropriate for the current | 104 // Creates and configures a new MenuConfig as appropriate for the current |
99 // platform. | 105 // platform. |
100 static MenuConfig* Create(); | 106 static MenuConfig* Create(); |
101 }; | 107 }; |
102 | 108 |
103 } // namespace views | 109 } // namespace views |
104 | 110 |
105 #endif // VIEWS_CONTROLS_MENU_MENU_CONFIG_H_ | 111 #endif // VIEWS_CONTROLS_MENU_MENU_CONFIG_H_ |
OLD | NEW |