Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: ui/views/controls/menu/menu_config_views.cc

Issue 12041085: Fix menu corners: the menu background was being painted as a rect when in fact, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "grit/ui_resources.h" 7 #include "grit/ui_resources.h"
8 #include "ui/base/layout.h" 8 #include "ui/base/layout.h"
9 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/image/image.h" 10 #include "ui/gfx/image/image.h"
11 #include "ui/gfx/image/image_skia.h" 11 #include "ui/gfx/image/image_skia.h"
12 #include "ui/native_theme/native_theme_aura.h" 12 #include "ui/native_theme/native_theme_aura.h"
13 #include "ui/views/controls/menu/menu_image_util.h" 13 #include "ui/views/controls/menu/menu_image_util.h"
14 14
15 namespace views { 15 namespace views {
16 16
17 namespace {
18 static const int kMenuCornerRadiusForAura = 2;
19 } // namespace
20
17 #if !defined(OS_WIN) 21 #if !defined(OS_WIN)
18 void MenuConfig::Init(const ui::NativeTheme* theme) { 22 void MenuConfig::Init(const ui::NativeTheme* theme) {
19 InitAura(); 23 InitAura();
20 } 24 }
21 #endif 25 #endif
22 26
23 void MenuConfig::InitAura() { 27 void MenuConfig::InitAura() {
24 ui::NativeTheme* theme = ui::NativeThemeAura::instance(); 28 ui::NativeTheme* theme = ui::NativeThemeAura::instance();
25 text_color = theme->GetSystemColor( 29 text_color = theme->GetSystemColor(
26 ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor); 30 ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor);
(...skipping 13 matching lines...) Expand all
40 separator_height = 15; 44 separator_height = 15;
41 separator_spacing_height = 7; 45 separator_spacing_height = 7;
42 separator_lower_height = 8; 46 separator_lower_height = 8;
43 separator_upper_height = 8; 47 separator_upper_height = 8;
44 font = rb.GetFont(ResourceBundle::BaseFont); 48 font = rb.GetFont(ResourceBundle::BaseFont);
45 label_to_arrow_padding = 20; 49 label_to_arrow_padding = 20;
46 label_to_accelerator_padding = 20; 50 label_to_accelerator_padding = 20;
47 always_use_icon_to_label_padding = true; 51 always_use_icon_to_label_padding = true;
48 align_arrow_and_shortcut = true; 52 align_arrow_and_shortcut = true;
49 offset_context_menus = true; 53 offset_context_menus = true;
54 corner_radius = kMenuCornerRadiusForAura;
50 } 55 }
51 56
52 #if !defined(OS_WIN) 57 #if !defined(OS_WIN)
53 // static 58 // static
54 const MenuConfig& MenuConfig::instance(const ui::NativeTheme* theme) { 59 const MenuConfig& MenuConfig::instance(const ui::NativeTheme* theme) {
55 static MenuConfig* views_instance = NULL; 60 static MenuConfig* views_instance = NULL;
56 if (!views_instance) 61 if (!views_instance)
57 views_instance = new MenuConfig(ui::NativeTheme::instance()); 62 views_instance = new MenuConfig(ui::NativeTheme::instance());
58 return *views_instance; 63 return *views_instance;
59 } 64 }
60 #endif 65 #endif
61 66
62 } // namespace views 67 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698