[gtk+] GtkDialog: avoid underallocations



commit 1743e18c8765ee6679f907802c7a9016afd52e31
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jun 9 20:40:45 2011 -0400

    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.

 gtk/gtkdialog.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index 6aae900..931ac61 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]