pub struct AnimationState {
pub enabled: bool,
pub focus_flash: Spring,
pub peek_badge: Spring,
pub panel_ratio: Spring,
pub modal_open: Spring,
pub reveal_springs: Vec<Spring>,
pub reveal_active: bool,
}Expand description
Centralized animation state for all spring-based animations in the TUI.
All springs are ticked on every CassMsg::Tick. When enabled is false
(CASS_DISABLE_ANIMATIONS=1), springs snap instantly to their targets.
Fields§
§enabled: boolMaster kill-switch: false when CASS_DISABLE_ANIMATIONS=1.
focus_flash: SpringFocus flash spring (0→1 = flash active → settled).
peek_badge: SpringPeek badge spring (0→1 = badge visible → hidden).
panel_ratio: SpringPanel resize spring (current → target split ratio, 0.0–1.0).
modal_open: SpringModal open spring (0 = closed, 1 = fully open).
reveal_springs: Vec<Spring>Result list reveal progress per slot (up to MAX_ANIMATED_ITEMS).
reveal_active: boolWhether a reveal sequence is actively playing.
Implementations§
Source§impl AnimationState
impl AnimationState
Sourcepub fn new(enabled: bool) -> Self
pub fn new(enabled: bool) -> Self
Create a new animation state. Pass false to disable all animations.
Sourcepub fn tick(&mut self, dt: Duration)
pub fn tick(&mut self, dt: Duration)
Tick all active springs by dt. If animations are disabled, snap to targets.
Sourcepub fn trigger_focus_flash(&mut self)
pub fn trigger_focus_flash(&mut self)
Trigger a focus flash (spring from 0→1).
Sourcepub fn show_peek_badge(&mut self)
pub fn show_peek_badge(&mut self)
Show peek badge (spring to 1), will need explicit hide.
Sourcepub fn hide_peek_badge(&mut self)
pub fn hide_peek_badge(&mut self)
Hide peek badge (spring to 0).
Sourcepub fn set_panel_ratio(&mut self, target: f64)
pub fn set_panel_ratio(&mut self, target: f64)
Animate panel split ratio to a new target.
Sourcepub fn open_modal(&mut self)
pub fn open_modal(&mut self)
Open a modal (spring to 1).
Sourcepub fn close_modal(&mut self)
pub fn close_modal(&mut self)
Close a modal (spring to 0).
Sourcepub fn start_reveal(&mut self, count: usize)
pub fn start_reveal(&mut self, count: usize)
Start a staggered reveal for count result items.
Sourcepub fn clear_reveal(&mut self)
pub fn clear_reveal(&mut self)
Clear any in-flight reveal sequence.
Sourcepub fn reveal_progress(&self, idx: usize) -> f64
pub fn reveal_progress(&self, idx: usize) -> f64
Get the reveal progress for item at index (0.0 = hidden, 1.0 = visible).
Sourcepub fn focus_flash_progress(&self) -> f32
pub fn focus_flash_progress(&self) -> f32
Get the focus flash progress (0.0 = just triggered, 1.0 = settled).
Sourcepub fn peek_badge_progress(&self) -> f32
pub fn peek_badge_progress(&self) -> f32
Get the peek badge visibility (0.0 = hidden, 1.0 = fully visible).
Sourcepub fn modal_progress(&self) -> f32
pub fn modal_progress(&self) -> f32
Get the modal open progress (0.0 = closed, 1.0 = fully open).
Sourcepub fn panel_ratio_value(&self) -> f64
pub fn panel_ratio_value(&self) -> f64
Get the animated panel split ratio.
Trait Implementations§
Source§impl Debug for AnimationState
impl Debug for AnimationState
Auto Trait Implementations§
impl Freeze for AnimationState
impl RefUnwindSafe for AnimationState
impl Send for AnimationState
impl Sync for AnimationState
impl Unpin for AnimationState
impl UnsafeUnpin for AnimationState
impl UnwindSafe for AnimationState
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().