]> Pileus Git - ~andy/gtk/commitdiff
GtkThemingEngine: Fix handles rendering
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 10 Jan 2011 22:23:54 +0000 (23:23 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 10 Jan 2011 22:52:36 +0000 (23:52 +0100)
The wrong class was being used, so the theming engine didn't
match it properly.

gtk/gtkpaned.c
gtk/gtkstylecontext.h
gtk/gtkthemingengine.c

index 1a7e51e359c47e5ab76eb38d74d612553120e583..6962059dd7d206a5e4db8608b04b943687b7bd65 100644 (file)
@@ -648,6 +648,7 @@ static void
 gtk_paned_init (GtkPaned *paned)
 {
   GtkPanedPrivate *priv;
+  GtkStyleContext *context;
 
   gtk_widget_set_has_window (GTK_WIDGET (paned), FALSE);
   gtk_widget_set_can_focus (GTK_WIDGET (paned), TRUE);
@@ -684,6 +685,9 @@ gtk_paned_init (GtkPaned *paned)
   priv->handle_pos.y = -1;
 
   priv->drag_pos = -1;
+
+  context = gtk_widget_get_style_context (GTK_WIDGET (paned));
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_PANE_SEPARATOR);
 }
 
 static void
index 309e2755b5fe1ce5d2e676cdefa091a7c46194fc..00836d6aa3bcdb035836631be9a279b92a047d23 100644 (file)
@@ -360,6 +360,13 @@ struct _GtkStyleContextClass
  */
 #define GTK_STYLE_CLASS_DND "dnd"
 
+/**
+ * GTK_STYLE_CLASS_PANE_SEPARATOR:
+ *
+ * A CSS class for a pane separator, such as those in #GtkPaned.
+ */
+#define GTK_STYLE_CLASS_PANE_SEPARATOR "pane-separator"
+
 /**
  * GTK_STYLE_CLASS_INFO:
  *
index f0d93dc220e4f81316e71beba7affb8726e7269f..061d6fbcba8105d40a5bab047add3c5a1d81f47e 100644 (file)
@@ -2604,7 +2604,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
   cairo_rectangle (cr, x, y, width, height);
   cairo_fill (cr);
 
-  if (gtk_theming_engine_has_class (engine, "grip"))
+  if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_GRIP))
     {
       GtkJunctionSides sides;
       gint skip = -1;
@@ -2869,7 +2869,7 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine,
 
       cairo_restore (cr);
     }
-  else if (gtk_theming_engine_has_class (engine, "paned"))
+  else if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_PANE_SEPARATOR))
     {
       if (width > height)
         for (xx = x + width / 2 - 15; xx <= x + width / 2 + 15; xx += 5)