pub enum MotionPropertyId {
}Expand description
Identifies the property a MotionTrack animates.
The property decides the default value, value unit, and shell binding used
during rendering. Built-in properties are understood by Fission shells.
MotionPropertyId::Custom is for widget-specific progress values that are
consumed by custom renderers rather than by the standard compositor.
use fission::motion::{
scalar, MotionPropertyId, MotionStartValue, MotionTrack,
};
let fade = MotionTrack::composite(
MotionPropertyId::Opacity,
MotionStartValue::Explicit(scalar(0.0)),
scalar(1.0),
);Variants§
Opacity
Compositor opacity; scalar where 0.0 is transparent and 1.0 is opaque.
TranslateX
Horizontal compositor translation in logical pixels.
TranslateY
Vertical compositor translation in logical pixels.
Scale
Uniform compositor scale; scalar where 1.0 is unchanged size.
Rotation
Compositor rotation in degrees.
Width
Layout width in logical pixels.
Height
Layout height in logical pixels.
LayoutX
Absolute layout x-position in logical pixels.
LayoutY
Absolute layout y-position in logical pixels.
LayoutWidth
Layout snapshot width in logical pixels.
LayoutHeight
Layout snapshot height in logical pixels.
IntrinsicWidth
Intrinsic width of the tracked widget in logical pixels.
IntrinsicHeight
Intrinsic height of the tracked widget in logical pixels.
CornerRadius
Paint/layout corner radius in logical pixels.
BackgroundColor
Paint background color.
BorderColor
Paint border color.
TextColor
Paint text color.
Custom(Arc<str>)
Widget-defined property consumed by custom renderers or widget code.
Implementations§
Source§impl MotionPropertyId
impl MotionPropertyId
Sourcepub fn opacity() -> Self
pub fn opacity() -> Self
Convenience constructor for MotionPropertyId::Opacity.
Sourcepub fn translate_x() -> Self
pub fn translate_x() -> Self
Convenience constructor for MotionPropertyId::TranslateX.
Sourcepub fn translate_y() -> Self
pub fn translate_y() -> Self
Convenience constructor for MotionPropertyId::TranslateY.
Sourcepub fn scale() -> Self
pub fn scale() -> Self
Convenience constructor for MotionPropertyId::Scale.
Sourcepub fn rotation() -> Self
pub fn rotation() -> Self
Convenience constructor for MotionPropertyId::Rotation.
Sourcepub fn custom(name: impl Into<String>) -> Self
pub fn custom(name: impl Into<String>) -> Self
Creates a widget-defined motion property.
Use a namespaced string such as "my_crate::chart_progress" to avoid
collisions with other widgets.
Sourcepub fn default_value(&self) -> MotionValue
pub fn default_value(&self) -> MotionValue
Returns the implicit starting value used when no runtime value exists.
Sourcepub fn default_scalar_value(&self) -> f32
pub fn default_scalar_value(&self) -> f32
Returns the default as a scalar-like value for compositor resolution.
Color and boolean defaults resolve to 0.0.
Trait Implementations§
Source§impl Clone for MotionPropertyId
impl Clone for MotionPropertyId
Source§fn clone(&self) -> MotionPropertyId
fn clone(&self) -> MotionPropertyId
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MotionPropertyId
impl Debug for MotionPropertyId
Source§impl<'de> Deserialize<'de> for MotionPropertyId
impl<'de> Deserialize<'de> for MotionPropertyId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for MotionPropertyId
Source§impl Hash for MotionPropertyId
impl Hash for MotionPropertyId
Source§impl PartialEq for MotionPropertyId
impl PartialEq for MotionPropertyId
Source§fn eq(&self, other: &MotionPropertyId) -> bool
fn eq(&self, other: &MotionPropertyId) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for MotionPropertyId
impl Serialize for MotionPropertyId
impl StructuralPartialEq for MotionPropertyId
Auto Trait Implementations§
impl Freeze for MotionPropertyId
impl RefUnwindSafe for MotionPropertyId
impl Send for MotionPropertyId
impl Sync for MotionPropertyId
impl Unpin for MotionPropertyId
impl UnsafeUnpin for MotionPropertyId
impl UnwindSafe for MotionPropertyId
Blanket Implementations§
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.