Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / ui / views / controls / menu / menu_config.cc
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.
4
5 #include "ui/views/controls/menu/menu_config.h"
6
7 #include "build/build_config.h"
8 #include "ui/base/layout.h"
9 #include "ui/native_theme/native_theme.h"
10
11 namespace views {
12
13 MenuConfig::MenuConfig(const ui::NativeTheme* theme)
14     : arrow_color(SK_ColorBLACK),
15       menu_vertical_border_size(3),
16       menu_horizontal_border_size(0),
17       submenu_horizontal_inset(3),
18       item_top_margin(4),
19       item_bottom_margin(3),
20       item_no_icon_top_margin(4),
21       item_no_icon_bottom_margin(4),
22       item_left_margin(10),
23       label_to_arrow_padding(10),
24       arrow_to_edge_padding(5),
25       icon_to_label_padding(10),
26       gutter_to_label(5),
27       check_width(16),
28       check_height(16),
29       radio_width(16),
30       arrow_width(9),
31       gutter_width(0),
32       separator_height(11),
33       separator_upper_height(3),
34       separator_lower_height(4),
35       separator_spacing_height(3),
36       render_gutter(false),
37       show_mnemonics(false),
38       scroll_arrow_height(3),
39       label_to_minor_text_padding(10),
40       item_min_height(0),
41       show_accelerators(true),
42       always_use_icon_to_label_padding(false),
43       align_arrow_and_shortcut(false),
44       offset_context_menus(false),
45       native_theme(theme),
46       show_delay(400),
47       corner_radius(0) {
48   // Use 40px tall menu items when running in touch optimized mode.
49   // For Windows use 40px tall menu items when running in touch optimized mode.
50   if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) {
51     item_top_margin = item_no_icon_top_margin = 12;
52     item_bottom_margin = item_no_icon_bottom_margin = 13;
53   }
54   Init(theme);
55 }
56
57 MenuConfig::~MenuConfig() {}
58
59 }  // namespace views