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
starttoendinclusive. - Style
- Colours of a timeline in one status.
- Timeline
- A timeline builder. Convert it into an
Elementto render.
Enums§
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
laneslanes. - index_
at - The step under
x, for a trackwidthwide holdingcountsteps placed evenly from its left edge to its right edge. - lane
- Creates a lane named
labelholdingspans. - position_
of - Where step
indexsits along a trackwidthwide. - span_
extent - The left and right edges of a span along a track
widthwide: 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, withcurrentselected. The current step is clamped to the steps. - track_
bounds - The part of
boundsa step maps onto: right of the labels, and inset by the playhead radius so the playhead never leaves the widget.