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

Unified Diff: ui/views/controls/menu/menu_scroll_view_container.cc

Issue 11026076: Added MenuConfig setter to MenuItemView, updated rest of the code to use set MenuConfig if it avail… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
« no previous file with comments | « ui/views/controls/menu/menu_item_view_win.cc ('k') | ui/views/controls/menu/menu_separator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_scroll_view_container.cc
diff --git a/ui/views/controls/menu/menu_scroll_view_container.cc b/ui/views/controls/menu/menu_scroll_view_container.cc
index 6301c4dec89b3039e02685773c17124bfb16a04e..ec7937b07bbac4e79e9b66deb3971dce48069f95 100644
--- a/ui/views/controls/menu/menu_scroll_view_container.cc
+++ b/ui/views/controls/menu/menu_scroll_view_container.cc
@@ -48,8 +48,9 @@ class MenuScrollButton : public View {
}
virtual gfx::Size GetPreferredSize() {
- return gfx::Size(MenuConfig::instance().scroll_arrow_height * 2 - 1,
- pref_height_);
+ return gfx::Size(
+ host_->GetMenuItem()->GetMenuConfig().scroll_arrow_height * 2 - 1,
+ pref_height_);
}
virtual bool CanDrop(const OSExchangeData& data) {
@@ -77,7 +78,7 @@ class MenuScrollButton : public View {
}
virtual void OnPaint(gfx::Canvas* canvas) {
- const MenuConfig& config = MenuConfig::instance();
+ const MenuConfig& config = host_->GetMenuItem()->GetMenuConfig();
// The background.
gfx::Rect item_bounds(0, 0, width(), height());
@@ -184,7 +185,18 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view)
MenuDelegate* delegate = content_view_->GetMenuItem()->GetDelegate();
if (delegate) {
- set_border(delegate->CreateMenuBorder());
+ Border* border = delegate->CreateMenuBorder();
+ if (!border) {
+ const MenuConfig& menu_config =
+ content_view_->GetMenuItem()->GetMenuConfig();
+ border = Border::CreateEmptyBorder(
+ menu_config.submenu_vertical_margin_size,
+ menu_config.submenu_horizontal_margin_size,
+ menu_config.submenu_vertical_margin_size,
+ menu_config.submenu_horizontal_margin_size);
+ }
+ set_border(border);
+
set_background(delegate->CreateMenuBackground());
}
}
« no previous file with comments | « ui/views/controls/menu/menu_item_view_win.cc ('k') | ui/views/controls/menu/menu_separator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698