[gtk+/gtk-style-context: 513/540] Don't add class "scrollbar" for every trough



commit 8d48e4751c60e028c0508312f9a10012cff9a262
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Nov 25 21:47:46 2010 -0500

    Don't add class "scrollbar" for every trough
    
    Turns out "trough" as a detail string is used in a variety
    of widgets, not all of which are scrollbars.

 gtk/gtkscrollbar.c |    4 ++++
 gtk/gtkstyle.c     |    5 +----
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c
index d04ed7c..df4ad75 100644
--- a/gtk/gtkscrollbar.c
+++ b/gtk/gtkscrollbar.c
@@ -118,6 +118,10 @@ gtk_scrollbar_class_init (GtkScrollbarClass *class)
 static void
 gtk_scrollbar_init (GtkScrollbar *scrollbar)
 {
+  GtkStyleContext *context;
+
+  context = gtk_widget_get_style_context (GTK_WIDGET (scrollbar));
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_SCROLLBAR);
 }
 
 static void
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index a59f1e4..9fea0d3 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -1805,10 +1805,7 @@ transform_detail_string (const gchar     *detail,
 	   strcmp (detail, "viewportbin") == 0)
     gtk_style_context_add_class (context, "viewport");
   else if (strncmp (detail, "trough", 6) == 0)
-    {
-      gtk_style_context_add_class (context, "scrollbar");
-      gtk_style_context_add_class (context, "trough");
-    }
+    gtk_style_context_add_class (context, "trough");
   else if (strcmp (detail, "spinbutton") == 0)
     gtk_style_context_add_class (context, "spinbutton");
   else if (strcmp (detail, "spinbutton_up") == 0)



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