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
3 // found in the LICENSE file.
5 #include "ui/views/controls/menu/menu_config.h"
7 #import <AppKit/AppKit.h>
9 #include "ui/gfx/image/image_skia.h"
10 #include "ui/native_theme/native_theme_mac.h"
11 #include "ui/views/controls/menu/menu_image_util.h"
15 void MenuConfig::Init(const ui::NativeTheme* theme) {
16 font_list = gfx::FontList(gfx::Font([NSFont menuFontOfSize:0.0]));
17 menu_vertical_border_size = 4;
18 item_top_margin = item_no_icon_top_margin = 1;
19 item_bottom_margin = item_no_icon_bottom_margin = 1;
21 arrow_to_edge_padding = 12;
22 icon_to_label_padding = 4;
25 separator_height = 13;
26 separator_upper_height = 7;
27 separator_lower_height = 6;
28 align_arrow_and_shortcut = true;
29 icons_in_label = true;
30 check_selected_combobox_item = true;
32 use_outer_border = false;
36 const MenuConfig& MenuConfig::instance(const ui::NativeTheme* theme) {
37 CR_DEFINE_STATIC_LOCAL(MenuConfig, mac_instance,
38 (theme ? theme : ui::NativeTheme::instance()));