diff options
author | Matthieu Gautier <matthieu.gautier@mgautier.fr> | 2016-05-04 12:42:40 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-05-19 12:10:07 -0400 |
commit | 2cb24c79751de60711488c84f49e53cd9ddee09a (patch) | |
tree | d1a489f1a8ebc27d21d4b9495759def5f9c855eb | |
parent | 0377a8c4085c8abf27adcf5b30ae103d15f378e8 (diff) | |
download | gtk+-2cb24c79751de60711488c84f49e53cd9ddee09a.tar.gz |
revealer: emit notify::child-revealed when animation stops
Depending of float rounding during target calculation, the size of the
GtkRevealer can be set to zero will the animation is not finished.
If the GtkRevealer is in a GtkPaned, it will be hidden and so the animation
will be stopped before it is finished.
In this case, force the emission of the child-revealed signal to let
client code know the animation is finished.
https://bugzilla.gnome.org/show_bug.cgi?id=765973
-rw-r--r-- | gtk/gtkrevealer.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c index 1df9fd9dd9..5f7fc73fb3 100644 --- a/gtk/gtkrevealer.c +++ b/gtk/gtkrevealer.c @@ -658,8 +658,11 @@ static void gtk_revealer_stop_animation (GtkRevealer *revealer) { GtkRevealerPrivate *priv = gtk_revealer_get_instance_private (revealer); - - priv->current_pos = priv->target_pos; + if (priv->current_pos != priv->target_pos) + { + priv->current_pos = priv->target_pos; + g_object_notify_by_pspec (G_OBJECT (revealer), props[PROP_CHILD_REVEALED]); + } if (priv->tick_id != 0) { gtk_widget_remove_tick_callback (GTK_WIDGET (revealer), priv->tick_id); |