app: draw the transport as icons and add a clip mode

The transport showed "Pause", "-10 s" and "+10 s" as words. It now shows
back, play or pause, and forward as shapes, with the words left to the
accessible label. The icons are SVG paths in `icons.rs`, so no font has
to carry them.

Clip mode: the Clip button opens a selection at the play head, the
scrubber drags either end (the end the press landed nearest), the span is
drawn on the track with a handle at each end, and the row under the
transport carries the range, Export clip and Done. Previewing stops at
the end of the selection.
This commit is contained in:
vhaudiquet committed 2026-11-19 00:48:32 +01:00
1 parent 4aac0ac70b
commit 4f2ee4256a
4 files changed
+286 -30

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
//! The few shapes the app draws itself: transport arrows, a play triangle and pause bars.
//!
//! Rune renders an [`Icon`] from SVG paths tinted with the element's colour, so these are plain
//! geometry at a 16 point box and need no font behind them.
use rune::Icon;
pub static PLAY: Icon = Icon {
name: "app-play",
view: 16.0,
body: r#"<path d="M5.4 3.4 12.6 8 5.4 12.6Z" fill="currentColor"/>"#,
};
pub static PAUSE: Icon = Icon {
name: "app-pause",
view: 16.0,
body: r#"<rect x="5" y="3.6" width="2.4" height="8.8" rx="0.6" fill="currentColor"/><rect x="8.6" y="3.6" width="2.4" height="8.8" rx="0.6" fill="currentColor"/>"#,
};
/// Two triangles pointing back: a step of ten seconds, as the button says.
pub static BACK: Icon = Icon {
name: "app-back",
view: 16.0,
body: r#"<path d="M2.8 8 7.2 4.6v6.8Z" fill="currentColor"/><path d="M7.6 8 12 4.6v6.8Z" fill="currentColor"/>"#,
};
pub static FORWARD: Icon = Icon {
name: "app-forward",
view: 16.0,
body: r#"<path d="M13.2 8 8.8 4.6v6.8Z" fill="currentColor"/><path d="M8.4 8 4 4.6v6.8Z" fill="currentColor"/>"#,
};