OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "grit/ui_resources.h" |
| 6 #include "ui/base/resource/resource_bundle.h" |
| 7 #include "ui/gfx/image/image_skia.h" |
| 8 #include "ui/native_theme/native_theme_mac.h" |
5 #include "ui/views/controls/menu/menu_config.h" | 9 #include "ui/views/controls/menu/menu_config.h" |
| 10 #include "ui/views/controls/menu/menu_image_util.h" |
6 | 11 |
7 namespace views { | 12 namespace views { |
8 | 13 |
9 void MenuConfig::Init(const ui::NativeTheme* theme) { | 14 void MenuConfig::Init(const ui::NativeTheme* theme) { |
10 NOTIMPLEMENTED(); | 15 submenu_horizontal_inset = 1; |
| 16 arrow_to_edge_padding = 20; |
| 17 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 18 arrow_width = rb.GetImageNamed(IDR_MENU_HIERARCHY_ARROW).Width(); |
| 19 gfx::ImageSkia check = GetMenuCheckImage(false); |
| 20 check_height = check.height(); |
| 21 item_min_height = 29; |
| 22 separator_spacing_height = 7; |
| 23 separator_lower_height = 8; |
| 24 separator_upper_height = 8; |
| 25 label_to_arrow_padding = 20; |
| 26 label_to_minor_text_padding = 20; |
| 27 always_use_icon_to_label_padding = true; |
| 28 align_arrow_and_shortcut = true; |
| 29 offset_context_menus = true; |
| 30 corner_radius = 2; |
| 31 } |
| 32 |
| 33 // static |
| 34 const MenuConfig& MenuConfig::instance(const ui::NativeTheme* theme) { |
| 35 static MenuConfig* views_instance = NULL; |
| 36 if (!views_instance) |
| 37 views_instance = new MenuConfig(theme ? |
| 38 theme : ui::NativeTheme::instance()); |
| 39 return *views_instance; |
11 } | 40 } |
12 | 41 |
13 } // namespace views | 42 } // namespace views |
OLD | NEW |