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

Unified Diff: ui/views/controls/menu/menu_host.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, 11 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/menu/menu_host.cc
diff --git a/ui/views/controls/menu/menu_host.cc b/ui/views/controls/menu/menu_host.cc
index bea46ac169922e5271b83a90b6788360a65e1370..f5685c70b2c7a6871a3bbe8d9b7e3edebd90e8ed 100644
--- a/ui/views/controls/menu/menu_host.cc
+++ b/ui/views/controls/menu/menu_host.cc
@@ -36,16 +36,24 @@ void MenuHost::InitMenuHost(Widget* parent,
params.has_dropshadow = true;
params.parent = parent ? parent->GetNativeView() : NULL;
params.bounds = bounds;
+
+ const MenuConfig& menu_config = submenu_->GetMenuItem()->GetMenuConfig();
sky 2013/01/25 20:30:24 Can you make sure the MenuController is correctly
varunjain 2013/01/25 22:57:29 I think it does not matter if the controller exist
sky 2013/01/25 23:43:18 If the code falls back to MenuConfig::instance() t
varunjain 2013/01/28 20:58:01 my point is that the default value of corner radiu
+ if (menu_config.corner_radius > 0)
+ params.transparent = true;
Init(params);
- if (ui::NativeTheme::IsNewMenuStyleEnabled()) {
+ if (ui::NativeTheme::IsNewMenuStyleEnabled() &&
sky 2013/01/25 20:30:24 I tend to think this code isn't needed at all. Set
varunjain 2013/01/25 22:57:29 I think so too. But I am not very familiar with th
sky 2013/01/25 23:43:18 Nuke it.
varunjain 2013/01/28 20:58:01 Done.
+ menu_config.corner_radius > 0) {
// TODO(yefim): Investigate it more on aura.
gfx::Path path;
- RoundRectPainter::CreateRoundRectPath(bounds, &path);
+ RoundRectPainter::CreateRoundRectPath(bounds, &path,
+ menu_config.corner_radius);
SetShape(path.CreateNativeRegion());
}
SetContentsView(contents_view);
+ if (menu_config.corner_radius > 0)
+ SetOpacity(0);
ShowMenuHost(do_capture);
}

Powered by Google App Engine
This is Rietveld 408576698