Struct ResponseStep
pub struct ResponseStep {
pub lift: f32,
pub tint: f32,
pub scale: f32,
pub glow: f32,
}Expand description
One state’s response: the four levers a theme may move.
Fields§
§lift: f32How far the fill steps toward the next surface (1 one surface
step, crate::tokens::Colors::lift_on).
tint: f32How much of the accent washes into the lift, 0..=0.25.
scale: f32The control’s scale about its own centre; below 1 it presses in.
glow: f32The lit inner edge’s opacity, 0..=0.5; 0 draws none.
Implementations§
§impl ResponseStep
impl ResponseStep
pub const LIFT_ADMITTED: RangeInclusive<f32>
pub const LIFT_ADMITTED: RangeInclusive<f32>
How far a lift may step, in surface steps: never none, because a
theme cannot remove the hover and press lift (docs/design-language.md,
“Theming”).
pub const TINT_ADMITTED: RangeInclusive<f32>
pub const TINT_ADMITTED: RangeInclusive<f32>
How much accent a lift may carry.
pub const SCALE_ADMITTED: RangeInclusive<f32>
pub const SCALE_ADMITTED: RangeInclusive<f32>
How far a control may scale about its centre.
pub const GLOW_ADMITTED: RangeInclusive<f32>
pub const GLOW_ADMITTED: RangeInclusive<f32>
How strongly the lit inner edge may draw.
pub const HOVER_LIFT: f32 = 0.5
pub const HOVER_LIFT: f32 = 0.5
The stock hover lift, half a surface step.
pub const PRESS_SCALE: f32 = 0.97
pub const PRESS_SCALE: f32 = 0.97
The stock press scale.
pub const REST: ResponseStep
pub const REST: ResponseStep
The stock idle response: no lift, no tint, no scale, no glow.
pub fn at(&self, t: f32) -> ResponseStep
pub fn at(&self, t: f32) -> ResponseStep
This step between the rest and self at t (0 at rest, 1
arrived), as the part motion’s progress moves it. A step that
changes no lever is the lever’s value at rest.
Trait Implementations§
§impl Clone for ResponseStep
impl Clone for ResponseStep
§fn clone(&self) -> ResponseStep
fn clone(&self) -> ResponseStep
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ResponseStep
impl Debug for ResponseStep
§impl Default for ResponseStep
impl Default for ResponseStep
§fn default() -> ResponseStep
fn default() -> ResponseStep
§impl<'de> Deserialize<'de> for ResponseStep
impl<'de> Deserialize<'de> for ResponseStep
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResponseStep, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResponseStep, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for ResponseStep
impl PartialEq for ResponseStep
§impl Serialize for ResponseStep
impl Serialize for ResponseStep
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for ResponseStep
impl StructuralPartialEq for ResponseStep
Auto Trait Implementations§
impl Freeze for ResponseStep
impl RefUnwindSafe for ResponseStep
impl Send for ResponseStep
impl Sync for ResponseStep
impl Unpin for ResponseStep
impl UnsafeUnpin for ResponseStep
impl UnwindSafe for ResponseStep
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<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 more