- add sources.
[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     : text_color(SK_ColorBLACK),
15       arrow_color(SK_ColorBLACK),
16       menu_vertical_border_size(3),
17       menu_horizontal_border_size(0),
18       submenu_horizontal_inset(3),
19       item_top_margin(4),
20       item_bottom_margin(3),
21       item_no_icon_top_margin(4),
22       item_no_icon_bottom_margin(4),
23       item_left_margin(10),
24       label_to_arrow_padding(10),
25       arrow_to_edge_padding(5),
26       icon_to_label_padding(10),
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(11),
36       separator_upper_height(3),
37       separator_lower_height(4),
38       separator_spacing_height(3),
39       render_gutter(false),
40       show_mnemonics(false),
41       scroll_arrow_height(3),
42       label_to_minor_text_padding(10),
43       item_min_height(0),
44       show_accelerators(true),
45       always_use_icon_to_label_padding(false),
46       align_arrow_and_shortcut(false),
47       offset_context_menus(false),
48       native_theme(theme),
49       show_delay(400),
50       corner_radius(0) {
51   // Use 40px tall menu items when running in touch optimized mode.
52   // For Windows use 40px tall menu items when running in touch optimized mode.
53   if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) {
54     item_top_margin = item_no_icon_top_margin = 12;
55     item_bottom_margin = item_no_icon_bottom_margin = 13;
56   }
57   Init(theme);
58 }
59
60 MenuConfig::~MenuConfig() {}
61
62 }  // namespace views