diff options
author | Timm Bäder <mail@baedert.org> | 2016-02-26 21:58:36 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-05-19 12:10:07 -0400 |
commit | 706b3ffc825a84ee3d984acaca70fccbe63e631c (patch) | |
tree | f3db6610df9656f0dd74ac07eecd3dca9e958145 | |
parent | f5b76a1f56eb2096d2762a7148b4969d039b7649 (diff) | |
download | gtk+-706b3ffc825a84ee3d984acaca70fccbe63e631c.tar.gz |
stack: Don't underallocate the last_child
-rw-r--r-- | gtk/gtkstack.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index 83c9da483e..b691b65b68 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -2254,19 +2254,24 @@ gtk_stack_allocate (GtkCssGadget *gadget, child_allocation.x = 0; child_allocation.y = 0; - child_allocation.width = allocation->width; - child_allocation.height = allocation->height; + if (priv->last_visible_child) { int min, nat; - + gtk_widget_get_preferred_width (priv->last_visible_child->widget, &min, &nat); + child_allocation.width = MAX (min, allocation->width); gtk_widget_get_preferred_height_for_width (priv->last_visible_child->widget, - allocation->width, + child_allocation.width, &min, &nat); + child_allocation.height = MAX (min, allocation->height); + gtk_widget_size_allocate (priv->last_visible_child->widget, &child_allocation); } + child_allocation.width = allocation->width; + child_allocation.height = allocation->height; + if (priv->visible_child) { int min, nat; |