summaryrefslogtreecommitdiff
path: root/gtk/gtktoolbar.c
diff options
context:
space:
mode:
authorMarco Brito <bcaza@null.net>2013-11-30 11:36:00 +0000
committerMatthias Clasen <mclasen@redhat.com>2013-12-01 17:20:30 -0500
commitd31f3e57669adcb2cf8139fa5025a4c5c7437719 (patch)
treeadf246cbf330d6320fd2d9a6f49d5f01dcf7939f /gtk/gtktoolbar.c
parentcc3c737088e3ac2be323cbcbfeb3a57551d14adf (diff)
downloadgtk+-d31f3e57669adcb2cf8139fa5025a4c5c7437719.tar.gz
Add class toolbar before the style context is created for the widget.
The call to gtk_button_set_relief() in gtk_toolbar_init() indirectly used the style context of the half-created widget, before we had a chance to add the "toolbar" style class to it. Reorder gtk_toolbar_init() to ensure that the proper style class is set first. https://bugzilla.gnome.org/show_bug.cgi?id=719595
Diffstat (limited to 'gtk/gtktoolbar.c')
-rw-r--r--gtk/gtktoolbar.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index d325a1a98c..c6b8dd37a4 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -678,6 +678,9 @@ gtk_toolbar_init (GtkToolbar *toolbar)
toolbar->priv = gtk_toolbar_get_instance_private (toolbar);
priv = toolbar->priv;
+ context = gtk_widget_get_style_context (GTK_WIDGET (toolbar));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOOLBAR);
+
gtk_widget_set_can_focus (GTK_WIDGET (toolbar), FALSE);
gtk_widget_set_has_window (GTK_WIDGET (toolbar), FALSE);
@@ -711,9 +714,6 @@ gtk_toolbar_init (GtkToolbar *toolbar)
priv->max_homogeneous_pixels = -1;
priv->timer = g_timer_new ();
-
- context = gtk_widget_get_style_context (GTK_WIDGET (toolbar));
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOOLBAR);
}
static void