Trait libbismuth::prelude::AnimationExt
source · pub trait AnimationExt: IsA<Animation> + Sealed + 'static {
Show 14 methods
// Provided methods
fn state(&self) -> AnimationState { ... }
fn target(&self) -> AnimationTarget { ... }
fn value(&self) -> f64 { ... }
fn widget(&self) -> Widget { ... }
fn pause(&self) { ... }
fn play(&self) { ... }
fn reset(&self) { ... }
fn resume(&self) { ... }
fn set_target(&self, target: &impl IsA<AnimationTarget>) { ... }
fn skip(&self) { ... }
fn connect_done<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... }
fn connect_state_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_target_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_value_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Expand description
Provided Methods§
sourcefn state(&self) -> AnimationState
fn state(&self) -> AnimationState
Gets the current value of @self.
The state indicates whether @self is currently playing, paused, finished or hasn’t been started yet.
§Returns
the animation value
sourcefn target(&self) -> AnimationTarget
fn target(&self) -> AnimationTarget
sourcefn widget(&self) -> Widget
fn widget(&self) -> Widget
Gets the widget @self was created for.
It provides the frame clock for the animation. It’s not strictly necessary for this widget to be same as the one being animated.
The widget must be mapped in order for the animation to work. If it’s not mapped, or if it gets unmapped during an ongoing animation, the animation will be automatically skipped.
§Returns
the animation widget
sourcefn pause(&self)
fn pause(&self)
Pauses a playing animation for @self.
Does nothing if the current state of @self isn’t BIS_ANIMATION_PLAYING
.
Sets state
to BIS_ANIMATION_PAUSED
.
sourcefn play(&self)
fn play(&self)
Starts the animation for @self.
If the animation is playing, paused or has been completed, restarts it from the beginning. This allows to easily play an animation regardless of whether it’s already playing or not.
Sets state
to BIS_ANIMATION_PLAYING
.
The animation will be automatically skipped if widget
is
unmapped, or if [gtk-enable-animations
][struct@crate::Gtk::Settings#gtk-enable-animations] is FALSE
.
As such, it’s not guaranteed that the animation will actually run. For
example, when using idle_add()
and starting an animation
immediately afterwards, it’s entirely possible that the idle callback will
run after the animation has already finished, and not while it’s playing.
sourcefn set_target(&self, target: &impl IsA<AnimationTarget>)
fn set_target(&self, target: &impl IsA<AnimationTarget>)
sourcefn connect_done<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_done<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
This signal is emitted when the animation has been completed, either on its
own or via calling skip()
.