GtkDialog: avoid underallocations

GtkDialog changes its size depending on style properties. If
we only do this in response to ::style-updated, it happens during
the initial realization of the dialog and leads to the dialog
'growing' between when we determine the initial window size and
when we allocate it that size. So, do this beforehand.
This commit is contained in:
Matthias Clasen
2011-06-09 20:40:45 -04:00
parent 3d1407a01a
commit 1743e18c87

View File

@ -349,6 +349,7 @@ update_spacings (GtkDialog *dialog)
"action-area-border", &action_area_border,
NULL);
gtk_container_set_border_width (GTK_CONTAINER (priv->vbox),
content_area_border);
if (!_gtk_box_get_spacing_set (GTK_BOX (priv->vbox)))
@ -397,6 +398,8 @@ gtk_dialog_init (GtkDialog *dialog)
gtk_window_set_type_hint (GTK_WINDOW (dialog),
GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT);
update_spacings (dialog);
}
static GtkBuildableIface *parent_buildable_iface;