diff options
author | yefim@chromium.org <yefim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-21 04:11:26 +0000 |
---|---|---|
committer | yefim@chromium.org <yefim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-21 04:11:26 +0000 |
commit | 0295939671826718c9795be8f7067d9c0abca79d (patch) | |
tree | 8677c5f033f9e2aad36a20045b7b3e3a6d05e494 /ui | |
parent | c4a1390451efcdaf9547127b5cd05814a527d471 (diff) | |
download | chromium_src-0295939671826718c9795be8f7067d9c0abca79d.zip chromium_src-0295939671826718c9795be8f7067d9c0abca79d.tar.gz chromium_src-0295939671826718c9795be8f7067d9c0abca79d.tar.bz2 |
fixed order of rendering menu backgrounds on Windows broken by my previous change.
BUG=162116
Review URL: https://chromiumcodereview.appspot.com/11416123
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168967 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/views/controls/menu/menu_item_view_win.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/ui/views/controls/menu/menu_item_view_win.cc b/ui/views/controls/menu/menu_item_view_win.cc index 461b9fe9..f91e1e8 100644 --- a/ui/views/controls/menu/menu_item_view_win.cc +++ b/ui/views/controls/menu/menu_item_view_win.cc @@ -39,8 +39,6 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { int state; NativeTheme::State control_state; - ui::NativeTheme* native_theme = GetNativeTheme(); - if (enabled()) { if (render_selection) { control_state = NativeTheme::kHovered; @@ -57,12 +55,13 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { control_state = NativeTheme::kDisabled; } - // Render the background. - if (mode == PB_NORMAL) { - gfx::Rect item_bounds(0, 0, width(), height()); - AdjustBoundsForRTLUI(&item_bounds); - NativeTheme::ExtraParams extra; - extra.menu_item.is_selected = render_selection; + // Render the background. If new menu style enabled then background need + // to be rendered before gutter. + gfx::Rect item_bounds(0, 0, width(), height()); + AdjustBoundsForRTLUI(&item_bounds); + NativeTheme::ExtraParams extra; + extra.menu_item.is_selected = render_selection; + if (mode == PB_NORMAL && NativeTheme::IsNewMenuStyleEnabled()) { config.native_theme->Paint(canvas->sk_canvas(), NativeTheme::kMenuItemBackground, control_state, item_bounds, extra); } @@ -81,6 +80,13 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { extra); } + // If using native theme then background (especialy when item is selected) + // need to be rendered after the gutter. + if ((mode == PB_NORMAL) && !NativeTheme::IsNewMenuStyleEnabled()) { + config.native_theme->Paint(canvas->sk_canvas(), + NativeTheme::kMenuItemBackground, control_state, item_bounds, extra); + } + int top_margin = GetTopMargin(); int bottom_margin = GetBottomMargin(); |