| 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 #include "third_party/skia/include/core/SkColor.h" |
| 9 | 10 |
| 10 namespace views { | 11 namespace views { |
| 11 | 12 |
| 12 // Layout type information for menu items. Use the instance() method to obtain | 13 // Layout type information for menu items. Use the instance() method to obtain |
| 13 // the MenuConfig for the current platform. | 14 // the MenuConfig for the current platform. |
| 14 struct MenuConfig { | 15 struct MenuConfig { |
| 15 MenuConfig() | 16 MenuConfig() |
| 16 : item_top_margin(3), | 17 : text_color(SK_ColorBLACK), |
| 18 item_top_margin(3), |
| 17 item_bottom_margin(4), | 19 item_bottom_margin(4), |
| 18 item_no_icon_top_margin(1), | 20 item_no_icon_top_margin(1), |
| 19 item_no_icon_bottom_margin(3), | 21 item_no_icon_bottom_margin(3), |
| 20 item_left_margin(4), | 22 item_left_margin(4), |
| 21 label_to_arrow_padding(10), | 23 label_to_arrow_padding(10), |
| 22 arrow_to_edge_padding(5), | 24 arrow_to_edge_padding(5), |
| 23 icon_to_label_padding(8), | 25 icon_to_label_padding(8), |
| 24 gutter_to_label(5), | 26 gutter_to_label(5), |
| 25 check_width(16), | 27 check_width(16), |
| 26 check_height(16), | 28 check_height(16), |
| (...skipping 10 matching lines...) Expand all Loading... |
| 37 // Resets the single shared MenuConfig instance. The next time instance() is | 39 // Resets the single shared MenuConfig instance. The next time instance() is |
| 38 // invoked a new MenuConfig is created and configured. | 40 // invoked a new MenuConfig is created and configured. |
| 39 static void Reset(); | 41 static void Reset(); |
| 40 | 42 |
| 41 // Returns the single shared MenuConfig instance, creating if necessary. | 43 // Returns the single shared MenuConfig instance, creating if necessary. |
| 42 static const MenuConfig& instance(); | 44 static const MenuConfig& instance(); |
| 43 | 45 |
| 44 // Font used by menus. | 46 // Font used by menus. |
| 45 gfx::Font font; | 47 gfx::Font font; |
| 46 | 48 |
| 47 // Font used when the menu has children. | 49 // Normal text color. |
| 48 gfx::Font font_with_controls; | 50 SkColor text_color; |
| 49 | 51 |
| 50 // Margins between the top of the item and the label. | 52 // Margins between the top of the item and the label. |
| 51 int item_top_margin; | 53 int item_top_margin; |
| 52 | 54 |
| 53 // Margins between the bottom of the item and the label. | 55 // Margins between the bottom of the item and the label. |
| 54 int item_bottom_margin; | 56 int item_bottom_margin; |
| 55 | 57 |
| 56 // Margins used if the menu doesn't have icons. | 58 // Margins used if the menu doesn't have icons. |
| 57 int item_no_icon_top_margin; | 59 int item_no_icon_top_margin; |
| 58 int item_no_icon_bottom_margin; | 60 int item_no_icon_bottom_margin; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 104 |
| 103 private: | 105 private: |
| 104 // Creates and configures a new MenuConfig as appropriate for the current | 106 // Creates and configures a new MenuConfig as appropriate for the current |
| 105 // platform. | 107 // platform. |
| 106 static MenuConfig* Create(); | 108 static MenuConfig* Create(); |
| 107 }; | 109 }; |
| 108 | 110 |
| 109 } // namespace views | 111 } // namespace views |
| 110 | 112 |
| 111 #endif // VIEWS_CONTROLS_MENU_MENU_CONFIG_H_ | 113 #endif // VIEWS_CONTROLS_MENU_MENU_CONFIG_H_ |
| OLD | NEW |