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

Unified Diff: src/platform/theme/theme_draw.cc

Issue 2089018: Menu theme tuning. (Closed) Base URL: ssh://git@chromiumos-git//chromeos
Patch Set: Created 10 years, 7 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 | « src/platform/theme/resources/gtkrc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/theme/theme_draw.cc
diff --git a/src/platform/theme/theme_draw.cc b/src/platform/theme/theme_draw.cc
index dca3d59e5c63410b444753cf0b8d02014e6aa1a6..34c36e9b92394175a7838e0ebad0720e1bd5388f 100644
--- a/src/platform/theme/theme_draw.cc
+++ b/src/platform/theme/theme_draw.cc
@@ -109,13 +109,20 @@ static const double INDICATOR_STROKE_R = 0;
static const double INDICATOR_STROKE_G = 0;
static const double INDICATOR_STROKE_B = 0;
+static const double MENU_BG_R = 1;
+static const double MENU_BG_G = 1;
+static const double MENU_BG_B = 1;
+
static const double MENU_BG_HIGHLIGHT_R = SELECTED_TEXT_BG_R;
static const double MENU_BG_HIGHLIGHT_G = SELECTED_TEXT_BG_G;
static const double MENU_BG_HIGHLIGHT_B = SELECTED_TEXT_BG_B;
-static const double MENU_BORDER_R = static_cast<double>(0x55) / 255.0;
-static const double MENU_BORDER_G = static_cast<double>(0x55) / 255.0;
-static const double MENU_BORDER_B = static_cast<double>(0x55) / 255.0;
+static const double MENU_GRADIENT_R0 = 1;
+static const double MENU_GRADIENT_G0 = 1;
+static const double MENU_GRADIENT_B0 = 1;
+static const double MENU_GRADIENT_R1 = static_cast<double>(0xF0) / 255.0;
+static const double MENU_GRADIENT_G1 = static_cast<double>(0xF0) / 255.0;
+static const double MENU_GRADIENT_B1 = static_cast<double>(0xF0) / 255.0;
// Ideal arrow size for menus.
static const int MENU_IDEAL_ARROW_SIZE = 5;
@@ -243,6 +250,9 @@ static const double TOOLTIP_SHADOW_ALPHAS[] = { 0.1, 0.2 };
// plus TOOLTIP_SHADOW_DEPTH.
static const int TOOLTIP_CORNER_RADIUS = 10 + TOOLTIP_SHADOW_DEPTH;
+// Widget name of GtkCombBox popup menu.
+static const char* kGtkComboBoxPopupMenu = "gtk-combobox-popup-menu";
+
// Widget name of ChromeOS options tab.
static const char* kChromeOsOptionsTabName = "chromeos-options-tab";
@@ -747,11 +757,17 @@ static void DrawMenuBorder(GtkStyle* style,
cairo_rectangle(cr.get(), x, y, w, h);
ScopedPattern pattern;
- AddRoundRectGradient(cr.get(), &pattern, h, false);
- cairo_fill_preserve(cr.get());
-
- cairo_set_source_rgb(cr.get(), MENU_BORDER_R, MENU_BORDER_G, MENU_BORDER_B);
- DrawSinglePixelWideRectangle(cr.get(), x, y, w, h);
+ if (WidgetHasName(widget, kGtkComboBoxPopupMenu)) {
+ cairo_set_source_rgb(cr.get(), MENU_BG_R, MENU_BG_G, MENU_BG_B);
+ } else {
+ pattern.reset(cairo_pattern_create_linear(0, 0, 0, h));
+ cairo_pattern_add_color_stop_rgb(pattern.get(), 0, MENU_GRADIENT_R0,
+ MENU_GRADIENT_G0, MENU_GRADIENT_B0);
+ cairo_pattern_add_color_stop_rgb(pattern.get(), 1, MENU_GRADIENT_R1,
+ MENU_GRADIENT_G1, MENU_GRADIENT_B1);
+ cairo_set_source(cr.get(), pattern.get());
+ }
+ cairo_fill(cr.get());
}
static void DrawMenuHorizontalSeparator(GtkStyle* style,
« no previous file with comments | « src/platform/theme/resources/gtkrc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698