app: delete a recording from its card's menu
The list could only open the review, so a clip that was not worth keeping stayed on disk forever. The dots beside Review open a menu drawn over this window, so it stays inside it, with room for more actions later. Delete asks before the clip and its timeline leave the disk and the row leaves the list.
This commit is contained in:
1 parent
b1cde7e783
commit
6ca825990d
6 files changed
+294
-11
No files matched your search
@@ -754,3 +754,54 @@ fn place(thumb: &rune::Live<[f32; 4]>, [x, y, w, h]: [f32; 4], at: rune::ScrollP
|
||||
let progress = (at.offset[1] / at.max[1]).clamp(0.0, 1.0);
|
||||
thumb.set([x + w - 12.0, y + progress * (h - height), 10.0, height]);
|
||||
}
|
||||
|
||||
/// A small square button holding an icon: the trigger a menu opens from. Its handler says what
|
||||
/// opening means; the menu itself is drawn in the window, so it can never leave it.
|
||||
pub fn menu_button(
|
||||
p: Paint,
|
||||
key: impl Into<String>,
|
||||
icon: &'static rune::Icon,
|
||||
label: &str,
|
||||
on_press: impl Fn(&mut App) + Send + Sync + 'static,
|
||||
) -> El {
|
||||
el().key(key.into())
|
||||
.role("button")
|
||||
.label(label)
|
||||
.focusable(true)
|
||||
.size(24.0, 24.0)
|
||||
.center()
|
||||
.radius(radius::MD)
|
||||
.hover(p.t.hover)
|
||||
.press(p.t.press)
|
||||
.on_press(on_press)
|
||||
.child(rune::icon(icon, 18.0).color(p.muted()).a11y_hidden())
|
||||
}
|
||||
|
||||
/// A quiet destructive button: danger ink for a confirm whose answer cannot be undone.
|
||||
pub fn button_danger(
|
||||
p: Paint,
|
||||
key: &str,
|
||||
label: &str,
|
||||
on_press: impl Fn(&mut App) + Send + Sync + 'static,
|
||||
) -> El {
|
||||
el().key(key)
|
||||
.role("button")
|
||||
.label(label)
|
||||
.focusable(true)
|
||||
.h(28.0)
|
||||
.px(14.0)
|
||||
.center()
|
||||
.radius(radius::MD)
|
||||
.fill(p.danger.alpha(0.14))
|
||||
.border(p.hair, p.danger.alpha(0.32))
|
||||
.hover(p.danger.alpha(0.22))
|
||||
.press(p.danger.alpha(0.3))
|
||||
.on_press(on_press)
|
||||
.child(
|
||||
text(label)
|
||||
.key("label")
|
||||
.font(type_::LABEL)
|
||||
.color(p.danger)
|
||||
.a11y_hidden(),
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user