[gtk+/gtk-3-14] GtkExpander: Fix a problem with resize-toplevel



commit 4de087262ee5f45ef393edc9dd89381255dcbc1d
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Oct 2 18:02:11 2014 -0400

    GtkExpander: Fix a problem with resize-toplevel
    
    The toplevel resizing was not working properly when the
    content had non-trivial height-for-width behavior (such
    as a wrapping label).

 gtk/gtkexpander.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index e8bf4b8..030f5a8 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -1244,23 +1244,21 @@ gtk_expander_resize_toplevel (GtkExpander *expander)
       if (toplevel && gtk_widget_get_realized (toplevel))
         {
           GtkAllocation toplevel_allocation;
+          GtkAllocation child_allocation;
 
           gtk_widget_get_allocation (toplevel, &toplevel_allocation);
+          gtk_widget_get_allocation (child, &child_allocation);
 
           if (priv->expanded)
             {
               GtkRequisition child_requisition;
 
-              gtk_widget_get_preferred_size (child, &child_requisition, NULL);
+              gtk_widget_get_preferred_height_for_width (child, child_allocation.width, 
&child_requisition.height, NULL);
 
               toplevel_allocation.height += child_requisition.height;
             }
           else
             {
-              GtkAllocation child_allocation;
-
-              gtk_widget_get_allocation (child, &child_allocation);
-
               toplevel_allocation.height -= child_allocation.height;
             }
 


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