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, and
Timeline::on_hover reports the step under the pointer so the app can
preview it. 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.
Steps sit evenly by default. Give each one a time with
Timeline::times to place them by when they happened, add a labelled
ruler, and shorten long idle stretches with
Timeline::compress_gaps.
Under the icedwright feature it reports itself as a slider named by
its label. The value is always the current step’s
index, from 0 to one less than the number of steps, however the steps
are placed, with a step of 1. The slider runs from the first tick to the
last. icedwright 0.0.7 and later reach a value with the arrow keys, one
step per press, so it lands on the right step even when steps are placed
by time; a test can also press a tick at its place in
Timing::positions.
Re-exports§
pub use crate::theme::Tone;
Structs§
- Break
- A stretch of the track where an idle gap is drawn shorter than it
lasted, from
starttoendalong the track (0 to 1), and how much time it leaves out. - Lane
- A labelled row of spans below the track.
- Mark
- A ruler mark: a time and where it falls along the track (0 to 1).
- 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. - Timing
- Where timed steps sit along a track, from 0 at its start to 1 at its end.
Enums§
Constants§
- LABEL_
WIDTH - Width of the lane labels when the timeline has lanes.
- LANE_
HEIGHT - Height of one lane row.
- MARK_
SPACING - The least room, in pixels, each ruler label is given along the track.
- PAGE
- Steps that a page action moves.
- PLAYHEAD_
RADIUS - Radius of the playhead.
- RULER_
HEIGHT - Height of the time ruler below the track and lanes.
- 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.
- time_
label - The default ruler label for
time, with marksintervalapart on a track that ends atend: milliseconds under a second, seconds under a minute, and minutes and seconds (or hours, minutes and seconds) beyond. - 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.