summaryrefslogtreecommitdiff
path: root/gtk/gtkstack.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-11-04 19:11:14 +0100
committerBenjamin Otte <otte@redhat.com>2015-11-04 19:39:29 +0100
commitb6b00c31d7f0eace34f8ea75b75adf1983e108fe (patch)
tree740d407a8923a5f4a20a44428f7a178c68009c2b /gtk/gtkstack.c
parentc580a9d01f31496349ca9599e5271f5137e47783 (diff)
downloadgtk+-b6b00c31d7f0eace34f8ea75b75adf1983e108fe.tar.gz
stack: Queue a resize/allocate when switching children
We only allocate a size to the currently visible child, so we obviously need to rerun allocation when the visible child changes. In the case where the stack is not homogenous, we also need to queue a resize because our size request just changed.
Diffstat (limited to 'gtk/gtkstack.c')
-rw-r--r--gtk/gtkstack.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 2f8b0f0dd0..edce6f4d07 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -1145,6 +1145,11 @@ set_visible_child (GtkStack *stack,
transition_type = get_simple_transition_type (i_first, transition_type);
}
+ if (priv->hhomogeneous && priv->vhomogeneous)
+ gtk_widget_queue_allocate (widget);
+ else
+ gtk_widget_queue_resize (widget);
+
g_object_notify_by_pspec (G_OBJECT (stack), stack_props[PROP_VISIBLE_CHILD]);
g_object_notify_by_pspec (G_OBJECT (stack),
stack_props[PROP_VISIBLE_CHILD_NAME]);