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

Unified Diff: ui/views/controls/menu/menu_separator_views.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_separator.h ('k') | ui/views/controls/menu/menu_separator_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_separator_views.cc
diff --git a/ui/views/controls/menu/menu_separator_views.cc b/ui/views/controls/menu/menu_separator_views.cc
index b3e69d686e9545e9076878b58c23c5ba9ee84ff5..11d9d50c1e73f451aac846c9e6b6d0923dd2b480 100644
--- a/ui/views/controls/menu/menu_separator_views.cc
+++ b/ui/views/controls/menu/menu_separator_views.cc
@@ -8,6 +8,7 @@
#include "ui/base/native_theme/native_theme.h"
#include "ui/gfx/canvas.h"
#include "ui/views/controls/menu/menu_config.h"
+#include "ui/views/controls/menu/menu_item_view.h"
namespace {
@@ -37,19 +38,20 @@ void MenuSeparator::OnPaint(gfx::Canvas* canvas) {
}
gfx::Size MenuSeparator::GetPreferredSize() {
- int height = MenuConfig::instance().separator_height;
+ const MenuConfig& menu_config = parent_menu_item_->GetMenuConfig();
+ int height = menu_config.separator_height;
switch(type_) {
case ui::SPACING_SEPARATOR:
- height = MenuConfig::instance().separator_spacing_height;
+ height = menu_config.separator_spacing_height;
break;
case ui::LOWER_SEPARATOR:
- height = MenuConfig::instance().separator_lower_height;
+ height = menu_config.separator_lower_height;
break;
case ui::UPPER_SEPARATOR:
- height = MenuConfig::instance().separator_upper_height;
+ height = menu_config.separator_upper_height;
break;
default:
- height = MenuConfig::instance().separator_height;
+ height = menu_config.separator_height;
break;
}
return gfx::Size(10, // Just in case we're the only item in a menu.
« no previous file with comments | « ui/views/controls/menu/menu_separator.h ('k') | ui/views/controls/menu/menu_separator_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698