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 |