[gtk+] stack: query preferred size for last_visible_child



commit ca63330b19c920a02d02f1bc96463ba156312483
Author: Christian Hergert <chergert redhat com>
Date:   Fri Mar 18 19:27:31 2016 -0700

    stack: query preferred size for last_visible_child
    
    When animating, we might be changing the size allocation of the previous
    stack child. However, we were not querying the size in the process
    meaning you would often see warnings about allocating the size without
    knowing what it should be.
    
    This simply adds an innocuous size request, since responding to last_child
    sizing requests is not all that critical in the transition.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763900

 gtk/gtkstack.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 8eaa090..89ddf58 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -2258,7 +2258,14 @@ gtk_stack_allocate (GtkCssGadget        *gadget,
   child_allocation.height = allocation->height;
 
   if (priv->last_visible_child)
-    gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation);
+    {
+      int min, nat;
+
+      gtk_widget_get_preferred_height_for_width (priv->last_visible_child->widget,
+                                                 allocation->width,
+                                                 &min, &nat);
+      gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation);
+    }
 
   if (priv->visible_child)
     {


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