Skip to main content

AnimProp

Enum AnimProp 

Source
#[non_exhaustive]
pub enum AnimProp {
Show 13 variants HoverAmount, PressAmount, FocusRingAlpha, SubtreeHoverAmount, SubtreePressAmount, SubtreeFocusAmount, AppFill, AppStroke, AppTextColor, AppOpacity, AppScale, AppTranslateX, AppTranslateY,
}
Expand description

Identifies a specific animatable property on a node. Used as part of the per-(node, prop) tracker key.

Two families:

  • State envelopes (HoverAmount, PressAmount, FocusRingAlpha) are 0..1 floats tracking how much of the corresponding state’s visual delta is currently applied. The library updates these on every keyed interactive node automatically; no author opt-in. Why envelopes and not absolute colours: apply_state in draw_ops computes the display colour by lerping between n.fill and state_color(n.fill) based on the envelope. That keeps state easing completely independent of build-value changes — when the author swaps a button’s fill mid-hover, the new fill takes effect instantly with the same hover envelope, no fighting between trackers.
  • App-driven absolute values (App*) are author-opted-in via crate::tree::El::animate. The tracker eases the value the build closure produces from the previous frame’s value to the new one.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

HoverAmount

0..1 amount of the hover-state visual delta currently applied. Eases 0→1 on pointer enter, 1→0 on pointer leave.

§

PressAmount

0..1 amount of the press-state visual delta currently applied. Eases 0→1 on press, 1→0 on release.

§

FocusRingAlpha

Focus-ring alpha — eases 0→1 on focus enter, 1→0 on focus leave. Lets the ring fade out after focus moves elsewhere.

§

SubtreeHoverAmount

0..1 amount tracking “is the hover target this node or any descendant?”. Eases 0→1 when the cursor enters the subtree, 1→0 when it leaves. Drives region-shaped hover affordances (hover_alpha, future hover-driven translate / scale / tint).

§

SubtreePressAmount

0..1 amount tracking “is the press target this node or any descendant?”. Subtree analogue of PressAmount.

§

SubtreeFocusAmount

0..1 amount tracking “is the focus target this node or any descendant?”. Subtree analogue of FocusRingAlpha. Composed with SubtreeHoverAmount by hover_alpha so keyboard focus reveals the same affordance hover does.

§

AppFill

App-driven fill colour — eases between the values the build closure produces across rebuilds.

§

AppStroke

App-driven stroke colour.

§

AppTextColor

App-driven text colour.

§

AppOpacity

App-driven paint-time alpha multiplier in [0, 1].

§

AppScale

App-driven uniform scale around the rect centre.

§

AppTranslateX

App-driven translate offset in logical pixels — X channel.

§

AppTranslateY

App-driven translate offset in logical pixels — Y channel.

Trait Implementations§

Source§

impl Clone for AnimProp

Source§

fn clone(&self) -> AnimProp

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 Copy for AnimProp

Source§

impl Debug for AnimProp

Source§

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

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

impl Eq for AnimProp

Source§

impl Hash for AnimProp

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for AnimProp

Source§

fn eq(&self, other: &AnimProp) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for AnimProp

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.