pub struct ModalAnimationState { /* private fields */ }Expand description
Current animation state for a modal.
Tracks progress through open/close animations and computes interpolated values for scale, opacity, and position offset.
Implementations§
Source§impl ModalAnimationState
impl ModalAnimationState
Sourcepub fn phase(&self) -> ModalAnimationPhase
pub fn phase(&self) -> ModalAnimationPhase
Get the current phase.
Sourcepub fn backdrop_progress(&self) -> f64
pub fn backdrop_progress(&self) -> f64
Get the backdrop progress value (0.0 to 1.0).
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Check if the modal is visible (should be rendered).
Sourcepub fn is_animating(&self) -> bool
pub fn is_animating(&self) -> bool
Check if animation is in progress.
Sourcepub fn set_reduced_motion(&mut self, enabled: bool)
pub fn set_reduced_motion(&mut self, enabled: bool)
Set reduced motion preference.
Sourcepub fn start_opening(&mut self)
pub fn start_opening(&mut self)
Start opening animation.
If already opening or open, this is a no-op. If closing, reverses direction and preserves momentum.
Sourcepub fn start_closing(&mut self)
pub fn start_closing(&mut self)
Start closing animation.
If already closing or closed, this is a no-op. If opening, reverses direction and preserves momentum.
Sourcepub fn force_open(&mut self)
pub fn force_open(&mut self)
Force the modal to be fully open (skip animation).
Sourcepub fn force_close(&mut self)
pub fn force_close(&mut self)
Force the modal to be fully closed (skip animation).
Sourcepub fn tick(&mut self, delta: Duration, config: &ModalAnimationConfig) -> bool
pub fn tick(&mut self, delta: Duration, config: &ModalAnimationConfig) -> bool
Advance the animation by the given delta time.
Returns true if the animation phase changed (e.g., Opening → Open).
Sourcepub fn eased_progress(&self, config: &ModalAnimationConfig) -> f64
pub fn eased_progress(&self, config: &ModalAnimationConfig) -> f64
Get the current eased progress for content animation.
Sourcepub fn eased_backdrop_progress(&self, config: &ModalAnimationConfig) -> f64
pub fn eased_backdrop_progress(&self, config: &ModalAnimationConfig) -> f64
Get the current eased progress for backdrop animation.
Sourcepub fn current_scale(&self, config: &ModalAnimationConfig) -> f64
pub fn current_scale(&self, config: &ModalAnimationConfig) -> f64
Get the current scale factor for the modal content.
Returns a value in [min_scale, 1.0].
Sourcepub fn current_opacity(&self, config: &ModalAnimationConfig) -> f64
pub fn current_opacity(&self, config: &ModalAnimationConfig) -> f64
Get the current opacity for the modal content.
Returns a value in [0.0, 1.0].
Sourcepub fn current_backdrop_opacity(&self, config: &ModalAnimationConfig) -> f64
pub fn current_backdrop_opacity(&self, config: &ModalAnimationConfig) -> f64
Get the current backdrop opacity.
Returns a value in [0.0, 1.0] to be multiplied with the backdrop’s configured opacity.
Sourcepub fn current_y_offset(
&self,
config: &ModalAnimationConfig,
modal_height: u16,
) -> i16
pub fn current_y_offset( &self, config: &ModalAnimationConfig, modal_height: u16, ) -> i16
Get the current Y offset for the modal content.
Returns an offset in cells (negative = above final position).
Sourcepub fn current_values(
&self,
config: &ModalAnimationConfig,
modal_height: u16,
) -> (f64, f64, f64, i16)
pub fn current_values( &self, config: &ModalAnimationConfig, modal_height: u16, ) -> (f64, f64, f64, i16)
Get all current animation values at once.
Returns (scale, opacity, backdrop_opacity, y_offset).
Trait Implementations§
Source§impl Clone for ModalAnimationState
impl Clone for ModalAnimationState
Source§fn clone(&self) -> ModalAnimationState
fn clone(&self) -> ModalAnimationState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more