[gnome-themes-standard] adwaita: improve GTK2 fallback menu stroke gradient



commit d65fc84f1c794c23c4233df629044224fde609df
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Oct 9 00:53:30 2012 -0400

    adwaita: improve GTK2 fallback menu stroke gradient
    
    Add some color stops to make the outline gradient more refined.

 themes/Adwaita/gtk-2.0/adwaita_engine.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/themes/Adwaita/gtk-2.0/adwaita_engine.c b/themes/Adwaita/gtk-2.0/adwaita_engine.c
index 593aad6..ab13712 100644
--- a/themes/Adwaita/gtk-2.0/adwaita_engine.c
+++ b/themes/Adwaita/gtk-2.0/adwaita_engine.c
@@ -95,11 +95,18 @@ adwaita_draw_box (GtkStyle * style,
       wm_is_fallback ())
     {
       cairo_t *cr = drawable_to_cairo (window, area);
-      cairo_pattern_t *pattern = cairo_pattern_create_linear
-        (x, y, x, y + height);
-
-      cairo_pattern_add_color_stop_rgba (pattern, 0, 1, 1, 1, 1);
-      cairo_pattern_add_color_stop_rgba (pattern, 1, 0.30, 0.30, 0.30, 1);
+      cairo_pattern_t *pattern = cairo_pattern_create_linear (x, y, x, y + height);
+      gdouble stop_1, stop_2, stop_3;
+
+      stop_1 = MIN (1.0, 6.0 / (gdouble) height);
+      stop_2 = MAX (stop_2, 0.33);
+      stop_3 = MAX (stop_3, 0.66);
+
+      cairo_pattern_add_color_stop_rgba (pattern, 0.0, 0.66, 0.66, 0.66, 0.0);
+      cairo_pattern_add_color_stop_rgba (pattern, stop_1, 0.66, 0.66, 0.66, 0.25);
+      cairo_pattern_add_color_stop_rgba (pattern, stop_2, 0.66, 0.66, 0.66, 0.80);
+      cairo_pattern_add_color_stop_rgba (pattern, stop_3, 0.66, 0.66, 0.66, 1.0);
+      cairo_pattern_add_color_stop_rgba (pattern, 1.0, 0.66, 0.66, 0.66, 1.0);
       cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
 
       cairo_set_source (cr, pattern);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]