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

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

Issue 12217146: Fixing the double border around rounded menus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 7 years, 10 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 | « no previous file | 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_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 afb0d06981cf7affdb479b9697febcdfe8520a39..6ea9e4710ffe64171a47b37d172b5bd3ef1ceda9 100644
--- a/ui/views/controls/menu/menu_scroll_view_container.cc
+++ b/ui/views/controls/menu/menu_scroll_view_container.cc
@@ -17,6 +17,10 @@
#include "ui/views/controls/menu/submenu_view.h"
#include "ui/views/round_rect_painter.h"
+#if defined(USE_AURA)
+#include "ui/native_theme/native_theme_aura.h"
+#endif
+
using ui::NativeTheme;
// Height of the scroll arrow.
@@ -270,14 +274,25 @@ void MenuScrollViewContainer::CreateDefaultBorder() {
const MenuConfig& menu_config =
content_view_->GetMenuItem()->GetMenuConfig();
+ bool use_border = true;
int padding = menu_config.corner_radius > 0 ?
kBorderPaddingDueToRoundedCorners : 0;
+
+#if defined(USE_AURA)
+ if (menu_config.native_theme == ui::NativeThemeAura::instance()) {
+ // In case of NativeThemeAura the border gets drawn with the shadow.
+ // Furthermore no additional padding is wanted.
+ use_border = false;
+ padding = 0;
+ }
+#endif
+
int top = menu_config.menu_vertical_border_size + padding;
int left = menu_config.menu_horizontal_border_size + padding;
int bottom = menu_config.menu_vertical_border_size + padding;
int right = menu_config.menu_horizontal_border_size + padding;
- if (NativeTheme::IsNewMenuStyleEnabled()) {
+ if (use_border && NativeTheme::IsNewMenuStyleEnabled()) {
set_border(views::Border::CreateBorderPainter(
new views::RoundRectPainter(menu_config.native_theme->GetSystemColor(
ui::NativeTheme::kColorId_MenuBorderColor),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698