[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / ui / views / controls / menu / menu_config.h
blob3cdbccdbf4dcdb63f49c8db8eab135ea16575866
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"
12 namespace ui {
13 class NativeTheme;
16 namespace views {
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);
22 ~MenuConfig();
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.
30 SkColor arrow_color;
32 // Menu border sizes.
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.
42 int item_top_margin;
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.
52 int item_left_margin;
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;
63 // Padding between the gutter and label.
64 int gutter_to_label;
66 // Size of the check.
67 int check_width;
68 int check_height;
70 // Width of the radio bullet.
71 int radio_width;
73 // Width of the submenu arrow.
74 int arrow_width;
76 // Width of the gutter. Only used if render_gutter is true.
77 int gutter_width;
79 // Height of a normal separator (ui::NORMAL_SEPARATOR).
80 int separator_height;
82 // Height of a ui::UPPER_SEPARATOR.
83 int separator_upper_height;
85 // Height of a ui::LOWER_SEPARATOR.
86 int separator_lower_height;
88 // Height of a ui::SPACING_SEPARATOR.
89 int separator_spacing_height;
91 // Whether or not the gutter should be rendered. The gutter is specific to
92 // Vista.
93 bool render_gutter;
95 // Are mnemonics shown?
96 bool show_mnemonics;
98 // Height of the scroll arrow.
99 int scroll_arrow_height;
101 // Padding between the label and minor text. Only used if there is an
102 // accelerator or sublabel.
103 int label_to_minor_text_padding;
105 // Minimum height of menu item.
106 int item_min_height;
108 // Whether the keyboard accelerators are visible.
109 bool show_accelerators;
111 // True if icon to label padding is always added with or without icon.
112 bool always_use_icon_to_label_padding;
114 // True if submenu arrow and shortcut right edge should be aligned.
115 bool align_arrow_and_shortcut;
117 // True if the context menu's should be offset from the cursor position.
118 bool offset_context_menus;
120 const ui::NativeTheme* native_theme;
122 // Delay, in ms, between when menus are selected or moused over and the menu
123 // appears.
124 int show_delay;
126 // Radius of the rounded corners of the menu border. Must be >= 0.
127 int corner_radius;
129 private:
130 // Configures a MenuConfig as appropriate for the current platform.
131 void Init(const ui::NativeTheme* theme);
133 // TODO: temporary until we standardize.
134 void InitAura(const ui::NativeTheme* theme);
137 } // namespace views
139 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONFIG_H_