pub struct PresenceTransition {
pub opacity: f32,
pub scale: f32,
pub offset: Vector,
pub collapse: bool,
pub enter: AnimationSpec,
pub exit: AnimationSpec,
}Expand description
How content looks at the absent end of an enter or exit, and how long each takes.
Content fades in from opacity, grows from scale, and slides in from
offset as it appears, and does the reverse as it leaves. With collapse,
the space it takes grows and shrinks too, so neighbors move smoothly;
otherwise it takes its full space for as long as any of it shows.
Scaling, sliding, and collapsing are movement: under reduced motion content only fades, and space opens at once on entry and closes after an exit.
Fields§
§opacity: f32§scale: f32§offset: Vector§collapse: bool§enter: AnimationSpec§exit: AnimationSpecImplementations§
Source§impl PresenceTransition
impl PresenceTransition
Sourcepub fn new() -> PresenceTransition
pub fn new() -> PresenceTransition
Fade and grow from 96% with the theme’s entrance and exit motion.
Sourcepub fn fade() -> PresenceTransition
pub fn fade() -> PresenceTransition
Only fade.
Sourcepub fn none() -> PresenceTransition
pub fn none() -> PresenceTransition
Appear and disappear at once.
pub const fn opacity(self, opacity: f32) -> PresenceTransition
pub const fn scale(self, scale: f32) -> PresenceTransition
Sourcepub const fn offset(self, offset: Vector) -> PresenceTransition
pub const fn offset(self, offset: Vector) -> PresenceTransition
Slide in from, and out to, offset from the resting position.
pub const fn collapse(self, collapse: bool) -> PresenceTransition
pub const fn enter(self, spec: AnimationSpec) -> PresenceTransition
pub const fn exit(self, spec: AnimationSpec) -> PresenceTransition
Sourcepub fn layer_properties(&self, presence: f32, movement: bool) -> LayerProperties
pub fn layer_properties(&self, presence: f32, movement: bool) -> LayerProperties
The layer presentation at presence (0 absent, 1 present). Without
movement, only the opacity changes.
Trait Implementations§
Source§impl Clone for PresenceTransition
impl Clone for PresenceTransition
Source§fn clone(&self) -> PresenceTransition
fn clone(&self) -> PresenceTransition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PresenceTransition
Source§impl Debug for PresenceTransition
impl Debug for PresenceTransition
Source§impl Default for PresenceTransition
impl Default for PresenceTransition
Source§fn default() -> PresenceTransition
fn default() -> PresenceTransition
Source§impl PartialEq for PresenceTransition
impl PartialEq for PresenceTransition
impl StructuralPartialEq for PresenceTransition
Auto Trait Implementations§
impl Forget for PresenceTransition
impl Freeze for PresenceTransition
impl Move for PresenceTransition
impl RefUnwindSafe for PresenceTransition
impl Send for PresenceTransition
impl Sync for PresenceTransition
impl Unpin for PresenceTransition
impl UnsafeUnpin for PresenceTransition
impl UnwindSafe for PresenceTransition
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.