diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2014-07-08 15:13:31 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-07-08 21:14:40 -0400 |
commit | ee0982ffe31cd342382402658aadb0d03a5c8b27 (patch) | |
tree | 24af051bc6400f6008ca5d4a012fe68f503bf5ae | |
parent | 75b71869ae546f2a5d64af9084cb17b220a5345a (diff) | |
download | gtk+-ee0982ffe31cd342382402658aadb0d03a5c8b27.tar.gz |
adjustment: Add private gtk_adjustment_get_target_value() method
This call returns either the target value if there is an ongoing animation,
or the current value if there is no animation.
-rw-r--r-- | gtk/gtkadjustment.c | 11 | ||||
-rw-r--r-- | gtk/gtkadjustmentprivate.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gtk/gtkadjustment.c b/gtk/gtkadjustment.c index 8cab120dc2..6ae5405ab4 100644 --- a/gtk/gtkadjustment.c +++ b/gtk/gtkadjustment.c @@ -428,6 +428,17 @@ gtk_adjustment_get_value (GtkAdjustment *adjustment) return adjustment->priv->value; } +gdouble +gtk_adjustment_get_target_value (GtkAdjustment *adjustment) +{ + g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.0); + + if (adjustment->priv->tick_id) + return adjustment->priv->target; + else + return adjustment->priv->value; +} + static void adjustment_set_value (GtkAdjustment *adjustment, gdouble value) diff --git a/gtk/gtkadjustmentprivate.h b/gtk/gtkadjustmentprivate.h index b36f13fa75..72ecaff433 100644 --- a/gtk/gtkadjustmentprivate.h +++ b/gtk/gtkadjustmentprivate.h @@ -29,6 +29,7 @@ void gtk_adjustment_enable_animation (GtkAdjustment *adjustment, guint duration); void gtk_adjustment_animate_to_value (GtkAdjustment *adjustment, gdouble value); +gdouble gtk_adjustment_get_target_value (GtkAdjustment *adjustment); G_END_DECLS |