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:
- Effective
Motion - The motion a widget may play: the
Motiontokens with the person’s reduced-motion setting applied. Read throughcrate::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
- Spring
Params - Spring
Presets
Enums§
- Motion
Source - 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.