[gnome-themes-standard] scale: correctly theme insensitive GtkScale state



commit 25dc423e950c4530675293627019e8de339465e5
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Mar 18 09:53:48 2011 -0400

    scale: correctly theme insensitive GtkScale state

 src/adwaita_engine.c           |   13 ++++++++++---
 themes/Adwaita/gtk-3.0/gtk.css |   10 ++++++++++
 2 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/src/adwaita_engine.c b/src/adwaita_engine.c
index 3ee9ab7..482d473 100644
--- a/src/adwaita_engine.c
+++ b/src/adwaita_engine.c
@@ -1368,8 +1368,13 @@ adwaita_engine_render_slider (GtkThemingEngine *engine,
 					"background-image", &pattern,
 					NULL);
 
-		style_pattern_set_matrix (pattern, width, height);
-		cairo_set_source (cr, pattern);
+		if (pattern != NULL) {
+			style_pattern_set_matrix (pattern, width, height);
+			cairo_set_source (cr, pattern);
+		} else {
+			gtk_theming_engine_get_background_color (engine, state, &color);
+			gdk_cairo_set_source_rgba (cr, &color);
+		}
 
 		cairo_fill_preserve (cr);
 
@@ -1387,7 +1392,9 @@ adwaita_engine_render_slider (GtkThemingEngine *engine,
 
 		cairo_stroke (cr);
 
-		cairo_pattern_destroy (pattern);
+		if (pattern != NULL) {
+			cairo_pattern_destroy (pattern);
+		}
 
 		if (border_pattern != NULL) {
 			cairo_pattern_destroy (border_pattern);
diff --git a/themes/Adwaita/gtk-3.0/gtk.css b/themes/Adwaita/gtk-3.0/gtk.css
index 2a567fd..4226e09 100644
--- a/themes/Adwaita/gtk-3.0/gtk.css
+++ b/themes/Adwaita/gtk-3.0/gtk.css
@@ -304,6 +304,11 @@ GtkScale.slider {
                                              to (shade (@internal_element_color, 1.35)));
 }
 
+GtkScale.slider:insensitive {
+    background-image: none;
+    -adwaita-border-gradient: none;
+}
+
 GtkScale.scale-has-marks-below.slider.horizontal {
     -adwaita-border-gradient: -gtk-gradient (linear,
                                              left top, left bottom,
@@ -339,6 +344,11 @@ GtkScale.trough {
     border-color: @internal_element_color;
 }
 
+GtkScale.trough:insensitive {
+    background-color: shade (@theme_bg_color, 1.20);
+    border-color: shade (@inactive_frame_color, 0.845);
+}
+
 GtkScale.trough.horizontal {
     background-image: -gtk-gradient (linear,
                                      left top, left bottom,



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