Skip to main content

Module motion

Module motion 

Expand description

Motion tokens — the one shared timing + spring vocabulary the whole UI (toolkit widgets AND shell chrome) animates against, so same-class gestures share a feel.

Structs§

Durations
Three-slot duration scale. Everything time-parametric picks one of these instead of a bespoke literal:
EffectiveMotion
The motion a widget may play: the Motion tokens with the person’s reduced-motion setting applied. Read through crate::Theme::motion; it is the one place reduced motion is decided, so every widget and the shell’s chrome follow the same rule (HIG §9.7, design-language “Motion”):
Gesture
Tuning for direct-manipulation gestures — the numbers that decide how a dragged surface resists, catches and coasts. Shared for the same reason the springs are: two controls that resist differently read as two unrelated machines.
Motion
SpringParams
SpringPresets

Enums§

MotionSource
What started a transition. Motion follows the input: a shortcut is a frequent expert action with a known result, so animating it adds latency to every repetition, while pointer and finger motion explains where things went.

Constants§

EDGE_AUTOSCROLL_BAND
How deep the band along a viewport’s edge is in which a drag scrolls the viewport (crate::edge_autoscroll).
EDGE_AUTOSCROLL_MAX_STEP
Longest frame step an edge autoscroll integrates, so a stalled frame does not fling.
EDGE_AUTOSCROLL_PX_PER_S
How fast a drag pressed right against a viewport’s edge scrolls it; it starts from nothing at the band’s inner side and grows with depth.
FLING_MIN_VELOCITY
The slowest release that still flings.
GROUP_SPRITE_REACH
How far a group sprite follows a drag before it stops.
MOVE_SETTLED_PX_PER_S
A dragged group that moves less than this per second is settled.
PUSH_SPEED
The rate a revealed top edge pushes the window down.

Functions§

rubber_band
iOS-style overscroll resistance.