|
|
0fe339 |
From 6a214c9bcd78be3814a125d52e4d1eb3ac7d2256 Mon Sep 17 00:00:00 2001
|
|
|
0fe339 |
From: Matthias Clasen <mclasen@redhat.com>
|
|
|
0fe339 |
Date: Thu, 2 Oct 2014 18:02:11 -0400
|
|
|
0fe339 |
Subject: [PATCH] GtkExpander: Fix a problem with resize-toplevel
|
|
|
0fe339 |
|
|
|
0fe339 |
The toplevel resizing was not working properly when the
|
|
|
0fe339 |
content had non-trivial height-for-width behavior (such
|
|
|
0fe339 |
as a wrapping label).
|
|
|
0fe339 |
---
|
|
|
0fe339 |
gtk/gtkexpander.c | 8 +++-----
|
|
|
0fe339 |
1 file changed, 3 insertions(+), 5 deletions(-)
|
|
|
0fe339 |
|
|
|
0fe339 |
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
|
|
|
0fe339 |
index e8bf4b8..030f5a8 100644
|
|
|
0fe339 |
--- a/gtk/gtkexpander.c
|
|
|
0fe339 |
+++ b/gtk/gtkexpander.c
|
|
|
0fe339 |
@@ -1244,23 +1244,21 @@ gtk_expander_resize_toplevel (GtkExpander *expander)
|
|
|
0fe339 |
if (toplevel && gtk_widget_get_realized (toplevel))
|
|
|
0fe339 |
{
|
|
|
0fe339 |
GtkAllocation toplevel_allocation;
|
|
|
0fe339 |
+ GtkAllocation child_allocation;
|
|
|
0fe339 |
|
|
|
0fe339 |
gtk_widget_get_allocation (toplevel, &toplevel_allocation);
|
|
|
0fe339 |
+ gtk_widget_get_allocation (child, &child_allocation);
|
|
|
0fe339 |
|
|
|
0fe339 |
if (priv->expanded)
|
|
|
0fe339 |
{
|
|
|
0fe339 |
GtkRequisition child_requisition;
|
|
|
0fe339 |
|
|
|
0fe339 |
- gtk_widget_get_preferred_size (child, &child_requisition, NULL);
|
|
|
0fe339 |
+ gtk_widget_get_preferred_height_for_width (child, child_allocation.width, &child_requisition.height, NULL);
|
|
|
0fe339 |
|
|
|
0fe339 |
toplevel_allocation.height += child_requisition.height;
|
|
|
0fe339 |
}
|
|
|
0fe339 |
else
|
|
|
0fe339 |
{
|
|
|
0fe339 |
- GtkAllocation child_allocation;
|
|
|
0fe339 |
-
|
|
|
0fe339 |
- gtk_widget_get_allocation (child, &child_allocation);
|
|
|
0fe339 |
-
|
|
|
0fe339 |
toplevel_allocation.height -= child_allocation.height;
|
|
|
0fe339 |
}
|
|
|
0fe339 |
|
|
|
0fe339 |
--
|
|
|
0fe339 |
1.9.3
|
|
|
0fe339 |
|