mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 14:10:30 +00:00
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.
This commit is contained in:
parent
75b71869ae
commit
ee0982ffe3
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user