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:
1 parent
4aac0ac70b
commit
4f2ee4256a
4 files changed
+286
-30
No files matched your search
@@ -434,6 +434,30 @@ pub fn button(
|
||||
)
|
||||
}
|
||||
|
||||
/// One transport control: an icon, its accessible label, round like the bar it sits in.
|
||||
pub fn media_button(
|
||||
p: Paint,
|
||||
key: &str,
|
||||
icon: &'static rune::Icon,
|
||||
label: &str,
|
||||
primary: bool,
|
||||
on_press: impl Fn(&mut App) + Send + Sync + 'static,
|
||||
) -> El {
|
||||
let ink = if primary { p.accent_ink } else { p.t.text };
|
||||
el().key(key)
|
||||
.role("button")
|
||||
.label(label)
|
||||
.focusable(true)
|
||||
.size(32.0, 32.0)
|
||||
.center()
|
||||
.radius(radius::MD)
|
||||
.fill(if primary { p.accent } else { p.t.control_off })
|
||||
.hover(p.t.hover)
|
||||
.press(p.t.press)
|
||||
.on_press(on_press)
|
||||
.child(rune::icon(icon, 16.0).color(ink).a11y_hidden())
|
||||
}
|
||||
|
||||
/// A small square button holding one glyph, for the corner of a card or a dialog.
|
||||
pub fn icon_button(
|
||||
p: Paint,
|
||||
|
||||
Reference in new issue
Block a user