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

Unified Diff: chrome/browser/ui/libgtkui/native_theme_gtk3.cc

Issue 2813703003: Use NativeTheme to draw vertical menu separators. (Closed)
Patch Set: use rectf Created 3 years, 8 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 | « chrome/browser/ui/libgtkui/native_theme_gtk2.cc ('k') | chrome/browser/ui/views/toolbar/app_menu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtkui/native_theme_gtk3.cc
diff --git a/chrome/browser/ui/libgtkui/native_theme_gtk3.cc b/chrome/browser/ui/libgtkui/native_theme_gtk3.cc
index 38db84c669d14f7d23df6617101163caa0f09887..e7cf499f8db6dd0c7c960485f9071bb5b36ca658 100644
--- a/chrome/browser/ui/libgtkui/native_theme_gtk3.cc
+++ b/chrome/browser/ui/libgtkui/native_theme_gtk3.cc
@@ -14,6 +14,7 @@
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/skbitmap_operations.h"
+#include "ui/gfx/skia_util.h"
#include "ui/native_theme/native_theme_dark_aura.h"
namespace libgtkui {
@@ -110,10 +111,6 @@ SkColor SkColorFromColorId(ui::NativeTheme::ColorId color_id) {
return GetFgColor(
"GtkMenu#menu GtkMenuItem#menuitem GtkLabel.accelerator");
case ui::NativeTheme::kColorId_MenuSeparatorColor:
- // MenuButton borders are used as vertical menu separators in Chrome.
- case ui::NativeTheme::kColorId_EnabledMenuButtonBorderColor:
- case ui::NativeTheme::kColorId_FocusedMenuButtonBorderColor:
- case ui::NativeTheme::kColorId_HoverMenuButtonBorderColor:
if (GtkVersionCheck(3, 20)) {
return GetSeparatorColor(
"GtkMenu#menu GtkSeparator#separator.horizontal");
@@ -520,6 +517,17 @@ void NativeThemeGtk3::PaintMenuSeparator(
State state,
const gfx::Rect& rect,
const MenuSeparatorExtraParams& menu_separator) const {
+ // TODO(estade): use GTK to draw vertical separators too. See
+ // crbug.com/710183
+ if (menu_separator.type == ui::VERTICAL_SEPARATOR) {
+ cc::PaintFlags paint;
+ paint.setStyle(cc::PaintFlags::kFill_Style);
+ paint.setColor(
+ GetSystemColor(ui::NativeTheme::kColorId_MenuSeparatorColor));
+ canvas->drawRect(gfx::RectToSkRect(rect), paint);
+ return;
+ }
+
auto separator_offset = [&](int separator_thickness) {
switch (menu_separator.type) {
case ui::LOWER_SEPARATOR:
« no previous file with comments | « chrome/browser/ui/libgtkui/native_theme_gtk2.cc ('k') | chrome/browser/ui/views/toolbar/app_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698