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

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

Issue 431473003: Make all views platforms use 'new' (cros-style) wrench menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compile errors Created 6 years, 4 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_views.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_separator_win.cc
diff --git a/ui/views/controls/menu/menu_separator_win.cc b/ui/views/controls/menu/menu_separator_win.cc
index ccbcaed263e88b1910e3d9f2a1d38f81153eb5ff..da310e22dce8f85e6f99715b7c5c2dab6bf185a4 100644
--- a/ui/views/controls/menu/menu_separator_win.cc
+++ b/ui/views/controls/menu/menu_separator_win.cc
@@ -25,7 +25,7 @@ void MenuSeparator::OnPaint(gfx::Canvas* canvas) {
return;
}
- int start_x = 0;
+ gfx::Rect separator_bounds = GetPaintBounds();
if (config.render_gutter) {
// If render_gutter is true, we're on Vista and need to render the
// gutter, then indent the separator from the gutter.
@@ -36,10 +36,9 @@ void MenuSeparator::OnPaint(gfx::Canvas* canvas) {
config.native_theme->Paint(
canvas->sk_canvas(), ui::NativeTheme::kMenuPopupGutter,
ui::NativeTheme::kNormal, gutter_bounds, extra);
- start_x = gutter_bounds.x() + config.gutter_width;
+ separator_bounds.set_x(gutter_bounds.x() + config.gutter_width);
}
- gfx::Rect separator_bounds(start_x, 0, width(), height());
ui::NativeTheme::ExtraParams extra;
extra.menu_separator.has_gutter = config.render_gutter;
config.native_theme->Paint(
@@ -47,14 +46,4 @@ void MenuSeparator::OnPaint(gfx::Canvas* canvas) {
ui::NativeTheme::kNormal, separator_bounds, extra);
}
-gfx::Size MenuSeparator::GetPreferredSize() const {
- const MenuConfig& config = parent_menu_item_->GetMenuConfig();
-
- if (config.native_theme == ui::NativeThemeAura::instance())
- return GetPreferredSizeAura();
-
- return gfx::Size(10, // Just in case we're the only item in a menu.
- config.separator_height);
-}
-
} // namespace views
« no previous file with comments | « ui/views/controls/menu/menu_separator_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698