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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
10 #include "ui/gfx/font.h" | 10 #include "ui/gfx/font.h" |
11 | 11 |
12 namespace views { | 12 namespace views { |
13 | 13 |
14 // Layout type information for menu items. Use the instance() method to obtain | 14 // Layout type information for menu items. Use the instance() method to obtain |
15 // the MenuConfig for the current platform. | 15 // the MenuConfig for the current platform. |
16 struct MenuConfig { | 16 struct MenuConfig { |
17 MenuConfig() | 17 MenuConfig(); |
18 : text_color(SK_ColorBLACK), | 18 ~MenuConfig(); |
19 item_top_margin(3), | |
20 item_bottom_margin(4), | |
21 item_no_icon_top_margin(1), | |
22 item_no_icon_bottom_margin(3), | |
23 item_left_margin(4), | |
24 label_to_arrow_padding(10), | |
25 arrow_to_edge_padding(5), | |
26 icon_to_label_padding(8), | |
27 gutter_to_label(5), | |
28 check_width(16), | |
29 check_height(16), | |
30 radio_width(16), | |
31 radio_height(16), | |
32 arrow_height(9), | |
33 arrow_width(9), | |
34 gutter_width(0), | |
35 separator_height(6), | |
36 render_gutter(false), | |
37 show_mnemonics(false), | |
38 scroll_arrow_height(3), | |
39 label_to_accelerator_padding(10) { | |
40 } | |
41 | 19 |
42 // Resets the single shared MenuConfig instance. The next time instance() is | 20 // Resets the single shared MenuConfig instance. The next time instance() is |
43 // invoked a new MenuConfig is created and configured. | 21 // invoked a new MenuConfig is created and configured. |
44 static void Reset(); | 22 static void Reset(); |
45 | 23 |
46 // Returns the single shared MenuConfig instance, creating if necessary. | 24 // Returns the single shared MenuConfig instance, creating if necessary. |
47 static const MenuConfig& instance(); | 25 static const MenuConfig& instance(); |
48 | 26 |
49 // Font used by menus. | 27 // Font used by menus. |
50 gfx::Font font; | 28 gfx::Font font; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 89 |
112 private: | 90 private: |
113 // Creates and configures a new MenuConfig as appropriate for the current | 91 // Creates and configures a new MenuConfig as appropriate for the current |
114 // platform. | 92 // platform. |
115 static MenuConfig* Create(); | 93 static MenuConfig* Create(); |
116 }; | 94 }; |
117 | 95 |
118 } // namespace views | 96 } // namespace views |
119 | 97 |
120 #endif // VIEWS_CONTROLS_MENU_MENU_CONFIG_H_ | 98 #endif // VIEWS_CONTROLS_MENU_MENU_CONFIG_H_ |
OLD | NEW |