pub enum SurfaceMotion {
Default,
Fade,
Scale,
SlideX(f32),
SlideY(f32),
Pop,
Composition(Vec<SurfaceMotion>),
Custom {
enter: Vec<MotionTrack>,
exit: Vec<MotionTrack>,
keep_rendered: bool,
},
}Expand description
Generic surface motion preset used by custom widgets and framework internals.
Built-in widgets expose widget-specific motion enums instead. Use
SurfaceMotion when authoring your own widget that needs a simple enter/exit
surface animation without defining a full public enum.
Variants§
Default
Curated default: fade plus scale.
Fade
Fade opacity in.
Scale
Scale from slightly smaller to normal size.
SlideX(f32)
Slide horizontally from the given pixel offset.
SlideY(f32)
Slide vertically from the given pixel offset.
Pop
Compound fade plus scale preset.
Composition(Vec<SurfaceMotion>)
Ordered composition of surface motion atoms.
Custom
Caller-provided native tracks.
Implementations§
Source§impl SurfaceMotion
impl SurfaceMotion
Sourcepub fn compose(items: impl IntoIterator<Item = Self>) -> Self
pub fn compose(items: impl IntoIterator<Item = Self>) -> Self
Flattens and normalizes an ordered composition.
Sourcepub fn enter_tracks(&self) -> Vec<MotionTrack>
pub fn enter_tracks(&self) -> Vec<MotionTrack>
Lowers this preset into enter tracks.
Sourcepub fn exit_tracks(&self) -> Vec<MotionTrack>
pub fn exit_tracks(&self) -> Vec<MotionTrack>
Lowers this preset into exit tracks.
Sourcepub fn keep_rendered(&self) -> bool
pub fn keep_rendered(&self) -> bool
Returns whether this preset requests persistent rendering after exit.
Trait Implementations§
Source§impl Add for SurfaceMotion
impl Add for SurfaceMotion
Source§impl Clone for SurfaceMotion
impl Clone for SurfaceMotion
Source§fn clone(&self) -> SurfaceMotion
fn clone(&self) -> SurfaceMotion
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 SurfaceMotion
impl Debug for SurfaceMotion
Source§impl<'de> Deserialize<'de> for SurfaceMotion
impl<'de> Deserialize<'de> for SurfaceMotion
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>,
Source§impl PartialEq for SurfaceMotion
impl PartialEq for SurfaceMotion
Source§fn eq(&self, other: &SurfaceMotion) -> bool
fn eq(&self, other: &SurfaceMotion) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SurfaceMotion
impl Serialize for SurfaceMotion
impl StructuralPartialEq for SurfaceMotion
Auto Trait Implementations§
impl Freeze for SurfaceMotion
impl RefUnwindSafe for SurfaceMotion
impl Send for SurfaceMotion
impl Sync for SurfaceMotion
impl Unpin for SurfaceMotion
impl UnsafeUnpin for SurfaceMotion
impl UnwindSafe for SurfaceMotion
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.