Skip to main content

SystemAnimations

Struct SystemAnimations 

Source
#[repr(C)]
pub struct SystemAnimations { pub caret_tween: CaretTweenCallback, pub selection_tween: SelectionTweenCallback, pub caret_tween_data: RefAny, pub selection_tween_data: RefAny, pub scroll_physics: OptionScrollPhysics, pub caret_tween_duration_ms: u32, pub selection_tween_duration_ms: u32, pub focus_ring_duration_ms: u32, pub caret_scroll_glide: bool, }
Expand description

Configuration of the SYSTEM-driven animations: physics-based scrolling and the caret / selection tweens. Lives on AppConfig so a platform or application can tune the feel without rebuilding azul.

The scroll physics override is applied ON TOP of the platform-discovered SystemStyle at App::create time (None keeps the per-platform preset). The tween slots always apply; set a duration to 0 to disable that tween (the caret / selection then jumps, the classic behavior).

Fields§

§caret_tween: CaretTweenCallback

The caret tween MATH: called every animation frame with the past / current caret rectangles and linear progress t; returns the rectangle to render. Default: ease-out cubic lerp.

§selection_tween: SelectionTweenCallback

The selection tween MATH: called every animation frame with the past / current selection band rectangles and linear progress t; returns the rectangles to render (must match the current count). Default: ease-out cubic lerp, rectangles paired by index.

§caret_tween_data: RefAny

User data passed to caret_tween on every invocation.

§selection_tween_data: RefAny

User data passed to selection_tween on every invocation.

§scroll_physics: OptionScrollPhysics

Overrides SystemStyle.scroll_physics (momentum, overscroll / rubber-band, wheel-vs-trackpad curves). None = platform default.

§caret_tween_duration_ms: u32

Duration of the caret-move tween in ms. 0 disables the tween. While the tween runs, caret blinking is suppressed (caret stays solid while it moves).

§selection_tween_duration_ms: u32

Duration of the selection tween in ms. 0 disables the tween.

§focus_ring_duration_ms: u32

Focus-ring glide duration in ms (ledger #29). 0 (the DEFAULT) disables the ring entirely — no visual change for existing apps; an app that opts in gets a focus outline that GLIDES between focused elements using the caret_tween interpolator (the ring is suppressed while a text-editing session owns focus — there the caret is the indicator).

§caret_scroll_glide: bool

Whether “scroll the caret into view” glides via the scroll-physics spring (true, the Word feel) or jumps instantly (false — also what Self::disabled sets, keeping e2e screenshots deterministic).

Implementations§

Source§

impl SystemAnimations

Source

pub fn disabled() -> Self

All system animations disabled: no scroll-physics override, tween durations 0 (caret / selection jump). Test drivers and deterministic harnesses use this so screenshots never catch geometry mid-glide.

Trait Implementations§

Source§

impl Clone for SystemAnimations

Source§

fn clone(&self) -> SystemAnimations

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SystemAnimations

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SystemAnimations

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.