]> Pileus Git - ~andy/gtk/commitdiff
spinbutton: fix style context path for internal buttons
authorCosimo Cecchi <cosimoc@gnome.org>
Wed, 19 Sep 2012 19:41:19 +0000 (15:41 -0400)
committerCosimo Cecchi <cosimoc@gnome.org>
Wed, 19 Sep 2012 19:41:19 +0000 (15:41 -0400)
We were adding one child too much to the style context path when
generating it for the internal buttons, which in turn caused sibling
selectors from the theme such as :first-child to apply to both buttons
under certain circumstances. Spotted by Lapo Calamandrei.

gtk/gtkspinbutton.c

index 915f8ba6f392e5e103865847a8675709bed46abb..bc1e4a8224f0a46935a9af7965fb3060a99fda72 100644 (file)
@@ -771,15 +771,9 @@ gtk_spin_button_panel_nthchildize_context (GtkSpinButton *spin_button,
   gtk_widget_path_iter_add_class (siblings_path, down_pos, GTK_STYLE_CLASS_SPINBUTTON);
 
   if (panel == priv->down_panel)
-    {
-      gtk_widget_path_append_with_siblings (path, siblings_path, up_pos);
-      gtk_widget_path_append_with_siblings (path, siblings_path, down_pos);
-    }
+    gtk_widget_path_append_with_siblings (path, siblings_path, down_pos);
   else
-    {
-      gtk_widget_path_append_with_siblings (path, siblings_path, down_pos);
-      gtk_widget_path_append_with_siblings (path, siblings_path, up_pos);
-    }
+    gtk_widget_path_append_with_siblings (path, siblings_path, up_pos);
 
   gtk_style_context_set_path (context, path);
   gtk_widget_path_unref (path);