#[non_exhaustive]pub struct MotionTokens {
pub fast: Duration,
pub normal: Duration,
pub slow: Duration,
pub enter: Easing,
pub exit: Easing,
pub fold: Easing,
pub stagger: Duration,
pub layout: Duration,
pub appear: Duration,
pub retarget: Duration,
pub layout_curve: Easing,
}Expand description
Timing gpui-cn components animate with.
Components sample motion through gpui-base (transition, spring,
Presence, Sequence, …), which snaps to the target when reduce
motion is on. These tokens only say how long and with what curve.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.fast: DurationHover, pressed, and focus-ring changes.
normal: DurationTooltip and popover enter and exit.
slow: DurationSheet, dialog, and measured reveal.
enter: EasingThe curve for something appearing or settling.
exit: EasingThe curve for something leaving.
fold: EasingThe curve for something that moves between two resting places in view: a sidebar sliding, a disclosure’s rows folding. An ease-in-out, since both ends are on screen and neither should snap; the enter curve, which leaps and then settles, is for something arriving.
stagger: DurationDelay between items in a staggered list.
layout: DurationA dock pane moving to its new slot when the layout changes: 460ms,
vd.layoutMs in the Trellis bundle.
appear: DurationA lifted dock pane shrinking into its floating card: 220ms,
appearMs in the Trellis bundle.
retarget: DurationHow long the pointer rests on a new drop target before the dock
previews it there: 150ms, _v in the Trellis bundle. A hysteresis,
not motion, so MotionTokens::none keeps it.
layout_curve: EasingThe curve of dock layout motion: ease-out quint, 1 - (1 - t)^5,
as Trellis moves its panels.
Implementations§
Source§impl MotionTokens
impl MotionTokens
Sourcepub fn fold_transition(&self) -> Transition
pub fn fold_transition(&self) -> Transition
A slow transition with the fold curve, for a region that folds.
Sourcepub fn slide_transition(&self) -> Transition
pub fn slide_transition(&self) -> Transition
A fast transition with the fold curve, for a thumb that slides
between the two ends of its track.
Sourcepub fn glide_transition(&self) -> Transition
pub fn glide_transition(&self) -> Transition
A normal transition with the enter curve, for content that
glides to a new resting place: a tab strip paging or taking a wheel
step. The enter curve leaves fast and settles, the shape of a
scroll that decelerates, so a run of steps reads as one motion.
Sourcepub fn fast_transition(&self) -> Transition
pub fn fast_transition(&self) -> Transition
A fast transition with the enter curve.
Sourcepub fn enter_transition(&self) -> Transition
pub fn enter_transition(&self) -> Transition
A normal transition with the enter curve.
Sourcepub fn exit_transition(&self) -> Transition
pub fn exit_transition(&self) -> Transition
A normal transition with the exit curve.
Sourcepub fn slow_transition(&self) -> Transition
pub fn slow_transition(&self) -> Transition
A slow transition with the enter curve.
Trait Implementations§
Source§impl Clone for MotionTokens
impl Clone for MotionTokens
Auto Trait Implementations§
impl !RefUnwindSafe for MotionTokens
impl !Send for MotionTokens
impl !Sync for MotionTokens
impl !UnwindSafe for MotionTokens
impl Freeze for MotionTokens
impl Unpin for MotionTokens
impl UnsafeUnpin for MotionTokens
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().