[gtk-theme-engine-clearlooks] Make default buttons blue



commit 70c18580cd6c95a19a2c09f38ceff418fb845772
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Nov 7 12:08:24 2010 -0500

    Make default buttons blue

 src/clearlooks_draw_gnome3.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/src/clearlooks_draw_gnome3.c b/src/clearlooks_draw_gnome3.c
index 90eeb72..ebba245 100644
--- a/src/clearlooks_draw_gnome3.c
+++ b/src/clearlooks_draw_gnome3.c
@@ -50,7 +50,6 @@ clearlooks_gnome3_draw_entry (cairo_t *cr,
 	top_color = *fg_color;	
 
 	cairo_save (cr);
-
 	cairo_set_line_width (cr, 1.0);
 	ge_cairo_rounded_rectangle (cr, x + 0.5, y + 0.5, width - 1,
 	                            height - 1, MAX(0, params->radius - 0.5),
@@ -139,6 +138,13 @@ clearlooks_gnome3_draw_button (cairo_t *cr,
 
 	cairo_save (cr);
 
+        if (params->is_default && !params->disabled) {
+                if (params->state_type == GTK_STATE_PRELIGHT)
+                        ge_shade_color (&colors->bg[GTK_STATE_SELECTED], 1.06, &bg_color);
+                else
+                        bg_color = colors->bg[GTK_STATE_SELECTED];
+        }
+
 	if (params->disabled) {
 		stroke_top_color = stroke_bottom_color = bg_color;
 		fill_top_color = fill_bottom_color = bg_color;
@@ -152,11 +158,11 @@ clearlooks_gnome3_draw_button (cairo_t *cr,
 		ge_shade_color (&bg_color, 1.09, &stroke_top_color);
 		ge_shade_color (&bg_color, 0.95, &stroke_bottom_color);
 
-		ge_shade_color (&bg_color, 1.04, &fill_top_color);
+		ge_shade_color (&bg_color, 1.06, &fill_top_color);
 		ge_shade_color (&bg_color, 0.95, &fill_bottom_color);
 	}
 
-	/* Border around everything */	
+	/* Border around everything */
 	ge_cairo_inner_rounded_rectangle (cr, x, y, width, height, params->radius, params->corners);
 	ge_cairo_set_color (cr, &border_color);
 	cairo_stroke (cr);
@@ -174,6 +180,14 @@ clearlooks_gnome3_draw_button (cairo_t *cr,
         if (colors->gradient) {
                 draw_gradient (cr, colors->gradient, x, y, width, height);
         }
+        else {
+                pattern = cairo_pattern_create_linear (x, y + 3, x, y + height - 6);
+                ge_cairo_pattern_add_color_stop_color (pattern, 0.0, &fill_top_color);
+                ge_cairo_pattern_add_color_stop_color (pattern, 1.0, &fill_bottom_color);
+                cairo_set_source (cr, pattern);
+                cairo_pattern_destroy (pattern);
+                cairo_fill (cr);
+        }
 
 	cairo_restore (cr);
 }



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