diff options
author | Timm Bäder <mail@baedert.org> | 2017-06-04 18:33:08 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-07-19 21:27:13 -0400 |
commit | ec1984bd9314fd3871f7550d8a3b0667a6f9d204 (patch) | |
tree | 51a81feb6bd9fb4a873311efa89003d58e2fa16c /gtk/gtkrevealer.c | |
parent | 9e5044725396a55faa43b3f620d9712d18bb68ff (diff) | |
download | gtk+-ec1984bd9314fd3871f7550d8a3b0667a6f9d204.tar.gz |
revealer: Request child size for NONE transition type
Previously, we would request a size of 0×0 when the transition type was
NONE and the child un-revealed, making the revealer in this case a
gtk_widget_set_visible replacement. Instead, to the exact same thing we
do in the CROSSFADE case and request the child size instead. This also
keeps the revealer from under allocating the child when the transition
type is set to NONE.
Diffstat (limited to 'gtk/gtkrevealer.c')
-rw-r--r-- | gtk/gtkrevealer.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c index 32b87cdc56..2dbe9c4a2b 100644 --- a/gtk/gtkrevealer.c +++ b/gtk/gtkrevealer.c @@ -385,10 +385,17 @@ gtk_revealer_set_position (GtkRevealer *revealer, child = gtk_bin_get_child (GTK_BIN (revealer)); if (child != NULL && new_visible != gtk_widget_get_child_visible (child)) - gtk_widget_set_child_visible (child, new_visible); + { + gtk_widget_set_child_visible (child, new_visible); + gtk_widget_queue_resize (GTK_WIDGET (revealer)); + } transition = effective_transition (revealer); - if (transition == GTK_REVEALER_TRANSITION_TYPE_CROSSFADE) + if (transition == GTK_REVEALER_TRANSITION_TYPE_NONE) + { + gtk_widget_queue_draw (GTK_WIDGET (revealer)); + } + else if (transition == GTK_REVEALER_TRANSITION_TYPE_CROSSFADE) { gtk_widget_set_opacity (GTK_WIDGET (revealer), priv->current_pos); gtk_widget_queue_draw (GTK_WIDGET (revealer)); @@ -550,8 +557,7 @@ set_height (GtkRevealer *revealer, GtkRevealerTransitionType transition; transition = effective_transition (revealer); - if (transition == GTK_REVEALER_TRANSITION_TYPE_NONE || - transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP || + if (transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP || transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN) { *minimum_height = round (*minimum_height * priv->current_pos); @@ -568,8 +574,7 @@ set_width (GtkRevealer *revealer, GtkRevealerTransitionType transition; transition = effective_transition (revealer); - if (transition == GTK_REVEALER_TRANSITION_TYPE_NONE || - transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT || + if (transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT || transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT) { *minimum_width = round (*minimum_width * priv->current_pos); |