| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "ui/views/controls/menu/menu_config.h" | 5 #include "ui/views/controls/menu/menu_config.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "ui/base/layout.h" | 8 #include "ui/base/layout.h" |
| 9 #include "ui/native_theme/native_theme.h" | 9 #include "ui/native_theme/native_theme.h" |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 render_gutter(false), | 39 render_gutter(false), |
| 40 show_mnemonics(false), | 40 show_mnemonics(false), |
| 41 scroll_arrow_height(3), | 41 scroll_arrow_height(3), |
| 42 label_to_accelerator_padding(10), | 42 label_to_accelerator_padding(10), |
| 43 item_min_height(0), | 43 item_min_height(0), |
| 44 show_accelerators(true), | 44 show_accelerators(true), |
| 45 always_use_icon_to_label_padding(false), | 45 always_use_icon_to_label_padding(false), |
| 46 align_arrow_and_shortcut(false), | 46 align_arrow_and_shortcut(false), |
| 47 offset_context_menus(false), | 47 offset_context_menus(false), |
| 48 native_theme(theme), | 48 native_theme(theme), |
| 49 show_delay(400) { | 49 show_delay(400), |
| 50 corner_radius(0) { |
| 50 // Use 40px tall menu items when running in touch optimized mode. | 51 // Use 40px tall menu items when running in touch optimized mode. |
| 51 // For Windows 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. |
| 52 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { | 53 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { |
| 53 item_top_margin = item_no_icon_top_margin = 12; | 54 item_top_margin = item_no_icon_top_margin = 12; |
| 54 item_bottom_margin = item_no_icon_bottom_margin = 13; | 55 item_bottom_margin = item_no_icon_bottom_margin = 13; |
| 55 } | 56 } |
| 56 Init(theme); | 57 Init(theme); |
| 57 } | 58 } |
| 58 | 59 |
| 59 MenuConfig::~MenuConfig() {} | 60 MenuConfig::~MenuConfig() {} |
| 60 | 61 |
| 61 void MenuConfig::AdjustForCommonTheme() { | 62 void MenuConfig::AdjustForCommonTheme() { |
| 62 render_gutter = false; | 63 render_gutter = false; |
| 63 item_top_margin = 6; | 64 item_top_margin = 6; |
| 64 item_bottom_margin = 6; | 65 item_bottom_margin = 6; |
| 65 separator_height = 15; | 66 separator_height = 15; |
| 66 menu_horizontal_border_size = 2; | 67 menu_horizontal_border_size = 2; |
| 67 menu_vertical_border_size = 8; | 68 menu_vertical_border_size = 8; |
| 68 } | 69 } |
| 69 | 70 |
| 70 } // namespace views | 71 } // namespace views |
| OLD | NEW |