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
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONFIG_H_
6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONFIG_H_
8 #include "third_party/skia/include/core/SkColor.h"
9 #include "ui/gfx/font_list.h"
10 #include "ui/views/views_export.h"
18 // Layout type information for menu items. Use the instance() method to obtain
19 // the MenuConfig for the current platform.
20 struct VIEWS_EXPORT MenuConfig
{
21 explicit MenuConfig(const ui::NativeTheme
* theme
);
24 static const MenuConfig
& instance(const ui::NativeTheme
* theme
);
26 // Font list used by menus.
27 gfx::FontList font_list
;
29 // Color for the arrow to scroll bookmarks.
33 int menu_vertical_border_size
;
34 int menu_horizontal_border_size
;
36 // Submenu horizontal inset with parent menu. This is the horizontal overlap
37 // between the submenu and its parent menu, not including the borders of
38 // submenu and parent menu.
39 int submenu_horizontal_inset
;
41 // Margins between the top of the item and the label.
44 // Margins between the bottom of the item and the label.
45 int item_bottom_margin
;
47 // Margins used if the menu doesn't have icons.
48 int item_no_icon_top_margin
;
49 int item_no_icon_bottom_margin
;
51 // Margins between the left of the item and the icon.
54 // Padding between the label and submenu arrow.
55 int label_to_arrow_padding
;
57 // Padding between the arrow and the edge.
58 int arrow_to_edge_padding
;
60 // Padding between the icon and label.
61 int icon_to_label_padding
;
67 // Width of the radio bullet.
70 // Width of the submenu arrow.
73 // Height of a normal separator (ui::NORMAL_SEPARATOR).
76 // Height of a ui::UPPER_SEPARATOR.
77 int separator_upper_height
;
79 // Height of a ui::LOWER_SEPARATOR.
80 int separator_lower_height
;
82 // Height of a ui::SPACING_SEPARATOR.
83 int separator_spacing_height
;
85 // Are mnemonics shown?
88 // Height of the scroll arrow.
89 int scroll_arrow_height
;
91 // Padding between the label and minor text. Only used if there is an
92 // accelerator or sublabel.
93 int label_to_minor_text_padding
;
95 // Minimum height of menu item.
98 // Whether the keyboard accelerators are visible.
99 bool show_accelerators
;
101 // True if icon to label padding is always added with or without icon.
102 bool always_use_icon_to_label_padding
;
104 // True if submenu arrow and shortcut right edge should be aligned.
105 bool align_arrow_and_shortcut
;
107 // True if the context menu's should be offset from the cursor position.
108 bool offset_context_menus
;
110 // True if the scroll container should add a border stroke around the menu.
111 bool use_outer_border
;
113 // True if the icon is part of the label rather than in its own column.
116 // True if a combobox menu should put a checkmark next to the selected item.
117 bool check_selected_combobox_item
;
119 const ui::NativeTheme
* native_theme
;
121 // Delay, in ms, between when menus are selected or moused over and the menu
125 // Radius of the rounded corners of the menu border. Must be >= 0.
129 // Configures a MenuConfig as appropriate for the current platform.
130 void Init(const ui::NativeTheme
* theme
);
132 // TODO: temporary until we standardize.
133 void InitAura(const ui::NativeTheme
* theme
);
138 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONFIG_H_