Skip to content

The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.

feat(timeline): Delete left and Delete right are buttons on the timeline's toolbar, as in CapCut (#400)

Jareera4859bbe9359
diff --git a/src/crates/concat/src/studio.rs b/src/crates/concat/src/studio.rs
index dc928c88..8da8401d 100644
--- a/src/crates/concat/src/studio.rs
+++ b/src/crates/concat/src/studio.rs
@@ -8208,6 +8208,8 @@ impl Studio {
editor.set_keys_redo(hint("redo").into());
editor.set_keys_split(hint("split").into());
editor.set_keys_split_tool(hint("split-tool").into());
+ editor.set_keys_delete_left(hint("delete-left").into());
+ editor.set_keys_delete_right(hint("delete-right").into());
editor.set_keys_pan(hint("pan").into());
editor.set_keys_preview_axis(hint("preview-axis").into());
self.publish_lanes(app, models);
diff --git a/src/crates/concat/ui/editor.slint b/src/crates/concat/ui/editor.slint
index 67c60a9c..56dc4978 100644
--- a/src/crates/concat/ui/editor.slint
+++ b/src/crates/concat/ui/editor.slint
@@ -483,6 +483,8 @@ export global Editor {
in-out property <string> keys-redo;
in-out property <string> keys-split;
in-out property <string> keys-split-tool;
+ in-out property <string> keys-delete-left;
+ in-out property <string> keys-delete-right;
in-out property <string> keys-pan;
in-out property <string> keys-preview-axis;
}
diff --git a/src/crates/concat/ui/icons.slint b/src/crates/concat/ui/icons.slint
index ba8ac348..dc20a42c 100644
--- a/src/crates/concat/ui/icons.slint
+++ b/src/crates/concat/ui/icons.slint
@@ -109,6 +109,8 @@ export enum Glyph {
pointer,
razor,
split,
+ delete-left,
+ delete-right,
merge,
trash,
magnet,
@@ -582,6 +584,17 @@ export component Icon inherits Rectangle {
+ " 1-2-2V5a2 2 0 0 1 2-2h3";
}
+ // The split glyph's cut and the half that stays, with a cross where the
+ // other half was: what Delete left and Delete right leave of a clip.
+ if root.glyph == Glyph.delete-left: Stroked {
+ size: root.size; tint: root.tint; weight: root.weight;
+ commands: "M12 2v20 M16 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3 M4 9l5 6 M9 9l-5 6";
+ }
+ if root.glyph == Glyph.delete-right: Stroked {
+ size: root.size; tint: root.tint; weight: root.weight;
+ commands: "M12 2v20 M8 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3 M15 9l5 6 M20 9l-5 6";
+ }
+
// lucide/merge
if root.glyph == Glyph.merge: Stroked {
size: root.size; tint: root.tint; weight: root.weight;
diff --git a/src/crates/concat/ui/timeline/tray.slint b/src/crates/concat/ui/timeline/tray.slint
index 74a1cede..25a88c89 100644
--- a/src/crates/concat/ui/timeline/tray.slint
+++ b/src/crates/concat/ui/timeline/tray.slint
@@ -277,6 +277,24 @@ export component TimelineTray inherits Rectangle {
? TimelineTool.select : TimelineTool.split);
}
}
+ // Delete left and Delete right, as in CapCut's toolbar: the clip under
+ // the playhead loses what is left, or right, of it. The same action
+ // as their keys (Q and W unless rebound), so a button and its key
+ // cannot disagree. https://github.com/jub0t/Concat/issues/400
+ TrayButton {
+ glyph: Glyph.delete-left;
+ label: I18n.t("shortcuts.deleteLeft") + (Editor.keys-delete-left == "" ? ""
+ : " (" + Editor.keys-delete-left + ")");
+ icon-size: 16px;
+ clicked => { Editor.shortcut("delete-left"); }
+ }
+ TrayButton {
+ glyph: Glyph.delete-right;
+ label: I18n.t("shortcuts.deleteRight") + (Editor.keys-delete-right == "" ? ""
+ : " (" + Editor.keys-delete-right + ")");
+ icon-size: 16px;
+ clicked => { Editor.shortcut("delete-right"); }
+ }
TrayButton {
glyph: Glyph.merge;
// The reason a blocked Merge is blocked rides on the button rather