Commit bb6b1f15 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Don't call construct_child here, since some apps make assumptions about

2006-06-08  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkbutton.c (gtk_button_style_set): Don't call
        construct_child here, since some apps make assumptions
        about the lifecycle of the constructed label.
parent fd3b835e
2006-06-08 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkbutton.c (gtk_button_style_set): Don't call
construct_child here, since some apps make assumptions
about the lifecycle of the constructed label.
2006-06-08 Alexander Larsson <alexl@redhat.com>
* gtk/gtkprintoperation-unix.c (finish_print):
......
2006-06-08 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkbutton.c (gtk_button_style_set): Don't call
construct_child here, since some apps make assumptions
about the lifecycle of the constructed label.
2006-06-08 Alexander Larsson <alexl@redhat.com>
* gtk/gtkprintoperation-unix.c (finish_print):
......
......@@ -1004,11 +1004,40 @@ gtk_button_unmap (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_button_parent_class)->unmap (widget);
}
static void
gtk_button_update_image_spacing (GtkButton *button)
{
GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (button);
GtkWidget *child;
gint spacing;
/* Keep in sync with gtk_button_construct_child,
* we only want to update the spacing if the box
* was constructed there.
*/
if (!button->constructed || !priv->image)
return;
child = GTK_BIN (button)->child;
if (GTK_IS_ALIGNMENT (child))
{
child = GTK_BIN (child)->child;
if (GTK_IS_BOX (child))
{
gtk_widget_style_get (GTK_WIDGET (button),
"image-spacing", &spacing,
NULL);
gtk_box_set_spacing (GTK_BOX (child), spacing);
}
}
}
static void
gtk_button_style_set (GtkWidget *widget,
GtkStyle *prev_style)
{
gtk_button_construct_child (GTK_BUTTON (widget));
gtk_button_update_image_spacing (GTK_BUTTON (widget));
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment