adw.spring_animation
Module for [SpringAnimation] class
Types 3
A spring-based adw.animation.Animation.
adw.spring_animation.SpringAnimation implements an animation driven by a physical model of a spring described by adw.spring_params.SpringParams, with a resting position in adw.spring_animation.SpringAnimation.valueTo, stretched to adw.spring_animation.SpringAnimation.valueFrom.
Since the animation is physically simulated, spring animations don't have a fixed duration. The animation will stop when the simulated spring comes to a rest - when the amplitude of the oscillations becomes smaller than adw.spring_animation.SpringAnimation.epsilon, or immediately when it reaches adw.spring_animation.SpringAnimation.valueTo if adw.spring_animation.SpringAnimation.clamp is set to TRUE. The estimated duration can be obtained with adw.spring_animation.SpringAnimation.estimatedDuration.
Due to the nature of spring-driven motion the animation can overshoot adw.spring_animation.SpringAnimation.valueTo before coming to a rest. Whether the animation will overshoot or not depends on the damping ratio of the spring. See adw.spring_params.SpringParams for more information about specific damping ratio values.
If adw.spring_animation.SpringAnimation.clamp is TRUE, the animation will abruptly end as soon as it reaches the final value, preventing overshooting.
Animations can have an initial velocity value, set via adw.spring_animation.SpringAnimation.initialVelocity, which adjusts the curve without changing the duration. This makes spring animations useful for deceleration at the end of gestures.
If the initial and final values are equal, and the initial velocity is not 0, the animation value will bounce and return to its resting position.
SpringAnimationGidBuilder builder() static nothrowGet builder for [adw.spring_animation.SpringAnimation] Returns: New builder objectbool clamp() @property nothrowGet `clamp` property. Returns: Whether the animation should be clamped.void clamp(bool propval) @property nothrowSet `clamp` property. Params: propval = Whether the animation should be clamped.void epsilon(double propval) @property nothrowSet `epsilon` property. Params: propval = Precision of the spring.uint estimatedDuration() @property nothrowGet `estimatedDuration` property. Returns: Estimated duration of the animation, in milliseconds.double initialVelocity() @property nothrowGet `initialVelocity` property. Returns: The initial velocity to start the animation with.void initialVelocity(double propval) @property nothrowSet `initialVelocity` property. Params: propval = The initial velocity to start the animation with.adw.spring_params.SpringParams springParams() @property nothrowGet `springParams` property. Returns: Physical parameters describing the spring.void springParams(adw.spring_params.SpringParams propval) @property nothrowSet `springParams` property. Params: propval = Physical parameters describing the spring.void valueFrom(double propval) @property nothrowSet `valueFrom` property. Params: propval = The value to animate from.void valueTo(double propval) @property nothrowSet `valueTo` property. Params: propval = The value to animate to.double velocity() @property nothrowGet `velocity` property. Returns: Current velocity of the animation.adw.spring_params.SpringParams getSpringParams() nothrowGets the physical parameters of the spring of self. Returns: the spring parametersdouble getValueFrom() nothrowGets the value self will animate from. Returns: the value to animate fromvoid setSpringParams(adw.spring_params.SpringParams springParams) nothrowSets the physical parameters of the spring of self.this(gtk.widget.Widget widget, double from, double to, adw.spring_params.SpringParams springParams, adw.animation_target.AnimationTarget target)Creates a new [adw.spring_animation.SpringAnimation] on widget.Fluent builder implementation template for adw.spring_animation.SpringAnimation
T clamp(bool propval) nothrowSet `clamp` property. Params: propval = Whether the animation should be clamped.T initialVelocity(double propval) nothrowSet `initialVelocity` property. Params: propval = The initial velocity to start the animation with.T springParams(adw.spring_params.SpringParams propval) nothrowSet `springParams` property. Params: propval = Physical parameters describing the spring. Returns: Builder instance for fluent chainingT valueFrom(double propval) nothrowSet `valueFrom` property. Params: propval = The value to animate from.Fluent builder for adw.spring_animation.SpringAnimation