Skip to main content

Module timeline

Module timeline 

Source
Available on crate feature timeline only.
Expand description

A timeline across a sequence of steps, such as the actions of a recorded session or the frames of a run: a tick per step coloured by its tone, a playhead on the current step, and optional lanes below the track that show spans over ranges of steps, such as tasks that ran across several.

The app owns the current step. Pressing or dragging along the track, or a shortcut from default_keymap, picks another one. Shortcuts act only while the timeline has keyboard focus (Tab reaches it) or was the last thing pressed, so several on one screen never fight over keys.

Re-exports§

pub use crate::theme::Tone;

Structs§

Lane
A labelled row of spans below the track.
Span
A run of steps in a lane, from start to end inclusive.
Style
Colours of a timeline in one status.
Timeline
A timeline builder. Convert it into an Element to render.

Enums§

Action
What a timeline shortcut does.
Status
How the pointer is interacting with a timeline.

Constants§

LABEL_WIDTH
Width of the lane labels when the timeline has lanes.
LANE_HEIGHT
Height of one lane row.
PAGE
Steps that a page action moves.
PLAYHEAD_RADIUS
Radius of the playhead.
TRACK_HEIGHT
Height of the track row.

Functions§

default_keymap
The default timeline shortcuts:
height
The height of a timeline with lanes lanes.
index_at
The step under x, for a track width wide holding count steps placed evenly from its left edge to its right edge.
lane
Creates a lane named label holding spans.
position_of
Where step index sits along a track width wide.
span_extent
The left and right edges of a span along a track width wide: half a step either side of its first and last steps, kept on the track.
style
Resolves the colours of a timeline for a status.
timeline
Creates a timeline over steps, one tone per step, with current selected. The current step is clamped to the steps.
track_bounds
The part of bounds a step maps onto: right of the labels, and inset by the playhead radius so the playhead never leaves the widget.