summaryrefslogtreecommitdiff
path: root/gtk/gtkexpander.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-10-02 18:02:11 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-10-02 18:06:02 -0400
commit6a214c9bcd78be3814a125d52e4d1eb3ac7d2256 (patch)
treec5a102689e067084cd5773f013194b90445b65af /gtk/gtkexpander.c
parenteb88ce429c4123cd339eae91873e9d58132aa332 (diff)
downloadgtk+-6a214c9bcd78be3814a125d52e4d1eb3ac7d2256.tar.gz
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).
Diffstat (limited to 'gtk/gtkexpander.c')
-rw-r--r--gtk/gtkexpander.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index e8bf4b8d9c..030f5a87ad 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;
}