Skip to content

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

Keys, focus, the Details panel and a project sheet, and tabs that reorder

Jareera2a60a5a9bcf
diff --git a/engine/crates/concat-host/src/session.rs b/engine/crates/concat-host/src/session.rs
index e7de2c54..42e4506b 100644
--- a/engine/crates/concat-host/src/session.rs
+++ b/engine/crates/concat-host/src/session.rs
@@ -211,6 +211,16 @@ impl Session {
(self.path.clone(), self.editor.to_document(&self.settings))
}
+ /// Changes the output frame rate. A zero or negative term is never a
+ /// real rate, only a caller bug, and is ignored for the reason a zero
+ /// dimension is in [`Session::prepare_save`].
+ pub fn set_rate(&mut self, num: i64, den: i64) {
+ if num > 0 && den > 0 {
+ self.settings.rate_num = num;
+ self.settings.rate_den = den;
+ }
+ }
+
/// Writes the session's document to its project folder.
pub fn save(
&mut self,
diff --git a/engine/crates/concat/src/format.rs b/engine/crates/concat/src/format.rs
index 48cb2216..011bf899 100644
--- a/engine/crates/concat/src/format.rs
+++ b/engine/crates/concat/src/format.rs
@@ -54,6 +54,22 @@ pub fn bezier_y_at_x(x1: f32, y1: f32, x2: f32, y2: f32, x: f32) -> f32 {
bezier_axis(y1, y2, t)
}
+/// hh:mm:ss:ff, non-drop-frame, the way the ruler and the tray spell a
+/// moment - see `Fmt.frames-timecode` in util.slint, which this mirrors so
+/// the Details panel's duration reads like the readout beside it.
+pub fn frames_timecode(seconds: f32, rate: f32) -> String {
+ let rate = rate.round().max(1.0) as i64;
+ let frames = (seconds.max(0.0) * rate as f32).floor() as i64;
+ let whole = frames / rate;
+ format!(
+ "{:02}:{:02}:{:02}:{:02}",
+ whole / 3600,
+ (whole / 60) % 60,
+ whole % 60,
+ frames % rate
+ )
+}
+
/// "hh:mm:ss", "mm:ss" or "ss" -> seconds. Slint's string type has no split().
pub fn parse_timecode(text: &str) -> f32 {
text.split(':')
diff --git a/engine/crates/concat/src/lib.rs b/engine/crates/concat/src/lib.rs
index 0f5f48cf..d7fb95a1 100644
--- a/engine/crates/concat/src/lib.rs
+++ b/engine/crates/concat/src/lib.rs
@@ -429,6 +429,9 @@ pub fn run() -> Result<(), slint::PlatformError> {
});
}
}));
+ editor.on_tab_moved(on_window!(|state, from: i32, to: i32| {
+ state.move_timeline(from, to);
+ }));
editor.on_tab_added(on_window!(|state| {
if let Some(id) = state.apply(concat_project::Command::AddTimeline) {
state.selection.clear();
@@ -686,48 +689,48 @@ pub fn run() -> Result<(), slint::PlatformError> {
// The clip the menu was opened on; failing that, the one clip that
// is selected, which is what the menu was showing anyway.
let target = state.menu_target.clone().or_else(|| state.sole_selection());
- let Some(id) = target else {
- return;
- };
- let Some(clip) = state.clip(&id).cloned() else {
- return;
- };
- match action.as_str() {
- "copy" => state.clipboard = Some(clip),
- "duplicate" => state.duplicate(&clip),
- "paste" => {
- if let Some(held) = state.clipboard.clone() {
- let mut source = held;
- // Pasted after the clip that was right-clicked, on its lane.
- source.track_id = clip.track_id.clone();
- source.start = clip.start + clip.duration - source.duration;
- state.duplicate(&source);
- }
- }
- "split" => {
- let at = state.playhead;
- state.selection = vec![id];
- state.split_at(at, true);
- }
- "mute" => {
- let volume = if clip.volume <= 0.0 { 1.0 } else { 0.0 };
- state.apply(concat_project::Command::UpdateClip {
- clip_id: id,
- patch: concat_project::commands::ClipPatch {
- volume: Some(volume),
- ..Default::default()
- },
- });
- }
- "lock" => state.toggle_lock(&clip.track_id),
- "delete" => {
- state.apply(concat_project::Command::RemoveClips { clip_ids: vec![id] });
- state.menu_target = None;
- }
- _ => {}
+ if let Some(id) = target {
+ state.clip_action(&id, action.as_str());
}
}));
+ // ── the keyboard ──
+ //
+ // A press on any pane's floor takes focus back from the field that had
+ // it; see Editor.blur. The chords that are also menu rows go through the
+ // menu's handler, so the key and the row cannot come apart.
+ editor.on_blur(|| Shell::with(|_, app| app.invoke_blur()));
+ editor.on_shortcut(move |action: SharedString| match action.as_str() {
+ "import" | "export" | "settings" | "zoom-in" | "zoom-out" | "start" | "end" | "snap" => {
+ Shell::with(|_, app| app.invoke_app_menu_selected(action.clone()));
+ }
+ _ => Shell::with(|shell, app| {
+ shell.studio.borrow_mut().shortcut(action.as_str());
+ shell.studio.borrow_mut().refresh_art();
+ shell.studio.borrow().publish(&app, &shell.models);
+ }),
+ });
+
+ // ── the project sheet ──
+ editor.on_modify_project(on_window!(|state| {
+ state.project_sheet_open();
+ }));
+ app.on_project_closed(on_window!(|state| {
+ state.project_sheet.open = false;
+ }));
+ app.on_project_name_edited(on_window!(|state, name: SharedString| {
+ state.project_sheet.name = name.to_string();
+ }));
+ app.on_project_size_changed(on_window!(|state, index: i32| {
+ state.project_sheet.size = index;
+ }));
+ app.on_project_rate_changed(on_window!(|state, index: i32| {
+ state.project_sheet.rate = (index.max(0) as usize).min(START_RATES.len() - 1);
+ }));
+ app.on_project_apply(on_window!(|state| {
+ state.project_apply();
+ }));
+
// ── the dialogs ──
app.on_export_clicked(on_window!(|state| {
state.export.open = true;
@@ -930,6 +933,12 @@ pub fn run() -> Result<(), slint::PlatformError> {
.and_then(|seat| seat.parse().ok())
.unwrap_or(-1)
});
+ app.global::<Payload>().on_tab_index(|text| {
+ text.strip_prefix("tab:")
+ .and_then(|rest| rest.split(':').next())
+ .and_then(|index| index.parse().ok())
+ .unwrap_or(-1)
+ });
// The picture the cursor carries, resolved through the same `incoming`
// the drop uses, memoised by theme and payload.
@@ -965,6 +974,26 @@ pub fn run() -> Result<(), slint::PlatformError> {
result = chip;
return;
}
+ // A timeline tab in flight wears the timeline pane's mark.
+ if let Some(rest) = payload.strip_prefix("tab:") {
+ let name = rest.splitn(2, ':').nth(1).unwrap_or_default();
+ let chip = slint::Image::load_from_svg_data(
+ chips::drag_chip_svg(
+ chips::pane_glyph("timeline"),
+ name,
+ "",
+ theme.get_accent(),
+ theme.get_field(),
+ theme.get_raised(),
+ theme.get_fg(),
+ )
+ .as_bytes(),
+ )
+ .unwrap_or_default();
+ chips.borrow_mut().insert(key, chip.clone());
+ result = chip;
+ return;
+ }
let studio = shell.studio.borrow();
let Some(plan) = studio.incoming(payload.as_str()) else {
return;
diff --git a/engine/crates/concat/src/studio.rs b/engine/crates/concat/src/studio.rs
index 8c533a7e..d9ab629a 100644
--- a/engine/crates/concat/src/studio.rs
+++ b/engine/crates/concat/src/studio.rs
@@ -40,7 +40,9 @@ use slint::{Model, SharedString, VecModel};
use crate::dock::{
Dock, DockLayout, SEAT_GAP, default_dock, lay_out, nearest_row, row_at, row_top,
};
-use crate::format::{bytes, colour_of, eta, hex_of, hex_with_alpha, wave_path, when_phrase};
+use crate::format::{
+ bytes, colour_of, eta, frames_timecode, hex_of, hex_with_alpha, wave_path, when_phrase,
+};
use crate::host::{Host, MediaArt, image_at, image_of, media_art, on_ui, spawn};
use crate::prefs::Preferences;
use crate::ui::*;
@@ -132,6 +134,17 @@ pub const TRANSCRIBE_LANGUAGES: [&str; 3] = ["auto", "en", "zh"];
/// The default Kokoro speaker: `af_heart`.
const DEFAULT_VOICE: i32 = 3;
+/// The project sheet: the Details panel's Modify button, as a form.
+#[derive(Default)]
+pub struct ProjectSheet {
+ pub open: bool,
+ pub name: String,
+ /// Row in `OUTPUTS`, or -1 for a frame the list does not carry.
+ pub size: i32,
+ /// Row in `START_RATES`.
+ pub rate: usize,
+}
+
/// The export sheet's state.
pub struct ExportState {
pub open: bool,
@@ -558,6 +571,7 @@ pub struct Studio {
/// text clip is drawn from; see `footprint`.
pub title_blocks: HashMap<String, (u32, u32)>,
pub drop: Option<DropPlan>,
+ pub project_sheet: ProjectSheet,
}
// ── conversions between the document and the window ─────────────────────
@@ -918,6 +932,7 @@ impl Studio {
last_commit: None,
title_blocks: HashMap::new(),
drop: None,
+ project_sheet: ProjectSheet::default(),
host,
};
studio.settings.language = studio.prefs.language.unwrap_or(0);
@@ -4161,6 +4176,29 @@ impl Studio {
);
editor.set_quality_index(self.quality as i32);
+ // The Details panel, and the sheet its Modify button opens.
+ let folder: SharedString = self
+ .session
+ .as_ref()
+ .map(|session| session.path().to_owned())
+ .unwrap_or_else(|| "—".to_owned())
+ .into();
+ editor.set_project_name(self.project_name.as_str().into());
+ editor.set_project_folder(folder.clone());
+ editor.set_project_output(format!("{width} × {height}").into());
+ editor.set_project_rate(format!("{:.2} fps", self.frame_rate()).into());
+ editor.set_project_duration(frames_timecode(self.duration(), self.frame_rate()).into());
+ editor.set_count_media(self.project().media.len() as i32);
+ editor.set_count_tracks(self.timeline().tracks.len() as i32);
+ editor.set_count_clips(self.timeline().clips.len() as i32);
+ app.set_project_sheet(ProjectSheetData {
+ open: self.project_sheet.open,
+ name: self.project_sheet.name.as_str().into(),
+ folder,
+ size: self.project_sheet.size,
+ rate: self.project_sheet.rate as i32,
+ });
+
let rows = self.menu();
editor.set_menu_height(Self::menu_height(&rows));
sync(&models.menu, rows);
@@ -4648,6 +4686,185 @@ impl Studio {
self.request_preview();
}
}
+
+ // ── the project sheet ──
+
+ /// Opens the sheet on the project as it stands.
+ pub fn project_sheet_open(&mut self) {
+ let (width, height) = self.output_size();
+ let (num, den) = self.session.as_ref().map_or((30, 1), |session| {
+ let settings = session.settings();
+ (settings.rate_num, settings.rate_den)
+ });
+ self.project_sheet = ProjectSheet {
+ open: true,
+ name: self.project_name.clone(),
+ size: OUTPUTS
+ .iter()
+ .position(|size| *size == (width as i32, height as i32))
+ .map_or(-1, |index| index as i32),
+ rate: START_RATES
+ .iter()
+ .position(|(_, n, d)| (*n, *d) == (num, den))
+ .unwrap_or(3),
+ };
+ }
+
+ /// Applies the sheet - the name, the frame and the rate together - and
+ /// closes it. The frame goes the way the monitor's picker sends it, so
+ /// the two cannot disagree about what a size means.
+ pub fn project_apply(&mut self) {
+ let sheet = std::mem::take(&mut self.project_sheet);
+ let name = sheet.name.trim().to_owned();
+ let size = usize::try_from(sheet.size)
+ .ok()
+ .and_then(|index| OUTPUTS.get(index).copied());
+ let (_, num, den) = START_RATES[sheet.rate.min(START_RATES.len() - 1)];
+ let Some(session) = self.session.as_mut() else {
+ return;
+ };
+ session.prepare_save(
+ (!name.is_empty()).then_some(name.as_str()),
+ size.map(|(width, _)| width as u32),
+ size.map(|(_, height)| height as u32),
+ );
+ session.set_rate(num, den);
+ if !name.is_empty() {
+ self.project_name = name;
+ }
+ self.dirty = true;
+ self.schedule_autosave();
+ self.request_preview();
+ }
+
+ // ── the keyboard, and the menu's verbs ──
+
+ /// A chord from the window's key table; see `Editor.shortcut`. The view
+ /// chords - zoom, the playhead's ends, the sheets - go through the app
+ /// menu's own handler in lib.rs, so a key and the row that advertises
+ /// it are one thing.
+ pub fn shortcut(&mut self, action: &str) {
+ match action {
+ "split" => {
+ let at = self.playhead;
+ self.split_at(at, false);
+ }
+ "split-selected" => {
+ let at = self.playhead;
+ self.split_at(at, true);
+ }
+ "select-all" => self.select_all(),
+ "copy" | "duplicate" | "mute" => {
+ if let Some(id) = self.sole_selection() {
+ self.clip_action(&id, action);
+ }
+ }
+ "paste" => {
+ let Some(held) = self.clipboard.clone() else {
+ return;
+ };
+ match self.sole_selection() {
+ // After the selected clip, on its lane, as the menu does.
+ Some(id) => self.clip_action(&id, "paste"),
+ // Nothing selected: at the playhead, on the lane it was
+ // copied from. `duplicate` lays a copy after its source,
+ // so the source is placed one length before the playhead.
+ None => {
+ let mut source = held;
+ source.start = f64::from(self.playhead) - source.duration;
+ self.duplicate(&source);
+ }
+ }
+ }
+ "tool-select" => self.tool = TimelineTool::Select,
+ // B toggles: pressing it with the razor up puts the pointer back.
+ "tool-razor" => {
+ self.tool = if self.tool == TimelineTool::Razor {
+ TimelineTool::Select
+ } else {
+ TimelineTool::Razor
+ };
+ }
+ _ => {}
+ }
+ }
+
+ /// One of the clip menu's verbs on clip `id`. The menu's rows and the
+ /// keyboard's chords both land here, so a shortcut and the row that
+ /// advertises it cannot disagree.
+ pub fn clip_action(&mut self, id: &str, action: &str) {
+ let Some(clip) = self.clip(id).cloned() else {
+ return;
+ };
+ match action {
+ "copy" => self.clipboard = Some(clip),
+ "duplicate" => self.duplicate(&clip),
+ "paste" => {
+ if let Some(held) = self.clipboard.clone() {
+ let mut source = held;
+ // Pasted after the clip that was right-clicked, on its lane.
+ source.track_id = clip.track_id.clone();
+ source.start = clip.start + clip.duration - source.duration;
+ self.duplicate(&source);
+ }
+ }
+ "split" => {
+ let at = self.playhead;
+ self.selection = vec![id.to_owned()];
+ self.split_at(at, true);
+ }
+ "mute" => {
+ let volume = if clip.volume <= 0.0 { 1.0 } else { 0.0 };
+ self.apply(Command::UpdateClip {
+ clip_id: id.to_owned(),
+ patch: ClipPatch {
+ volume: Some(volume),
+ ..Default::default()
+ },
+ });
+ }
+ "lock" => self.toggle_lock(&clip.track_id),
+ "delete" => {
+ self.apply(Command::RemoveClips {
+ clip_ids: vec![id.to_owned()],
+ });
+ self.menu_target = None;
+ }
+ _ => {}
+ }
+ }
+
+ /// Every clip on an unlocked lane.
+ pub fn select_all(&mut self) {
+ self.selection = self
+ .timeline()
+ .clips
+ .iter()
+ .filter(|clip| !self.locked(&clip.track_id))
+ .map(|clip| clip.id.clone())
+ .collect();
+ }
+
+ /// Tab `from` dropped at `slot`, a position counted over the strip as
+ /// it stands; the command counts with the tab already removed.
+ pub fn move_timeline(&mut self, from: i32, slot: i32) {
+ let Some(from) = usize::try_from(from).ok() else {
+ return;
+ };
+ let Some(timeline) = self.project().timelines.get(from) else {
+ return;
+ };
+ let id = timeline.id.clone();
+ let slot = slot.max(0) as usize;
+ let index = if from < slot { slot - 1 } else { slot };
+ if index == from {
+ return;
+ }
+ self.apply(Command::MoveTimeline {
+ timeline_id: id,
+ index,
+ });
+ }
}
#[cfg(test)]
diff --git a/engine/crates/concat/ui/app.slint b/engine/crates/concat/ui/app.slint
index db6b618c..fcebe38f 100644
--- a/engine/crates/concat/ui/app.slint
+++ b/engine/crates/concat/ui/app.slint
@@ -23,6 +23,7 @@ import { MediaFilter, MediaItemData, MediaKind } from "workspace/media-pane.slin
import { ContextMenu, MenuItemData, MenuRow } from "primitives/context-menu.slint";
import { ExportData, ExportDialog, ExportPhase } from "dialogs/export.slint";
import { ModelData, SettingsData, SettingsDialog, SystemFactData } from "dialogs/settings.slint";
+import { ProjectDialog, ProjectSheetData } from "dialogs/project.slint";
import { DockDivider, DockSide, SeatBox } from "dock.slint";
import { Editor } from "editor.slint";
import { PaneKind } from "workspace/pane-switcher.slint";
@@ -50,7 +51,7 @@ export {
ClipData, ClipField, ClipKind, ClipTextField, DropData, SelectedClipData,
StageGuideData, StageItemData, TextAlignment, TimelineTabData, TimelineTool,
TrackData, TrackSize, MenuItemData, MenuRow, ExportData, ExportPhase, ModelData, SettingsData,
- RecentProjectData, StartData, SystemFactData, ToastData,
+ RecentProjectData, StartData, SystemFactData, ToastData, ProjectSheetData,
}
export component App inherits Window {
@@ -154,6 +155,22 @@ export component App inherits Window {
callback open-settings();
callback export-clicked();
+ /// The project sheet, opened from the Details panel.
+ in property <ProjectSheetData> project-sheet;
+ callback project-closed();
+ callback project-name-edited(name: string);
+ callback project-size-changed(index: int);
+ callback project-rate-changed(index: int);
+ callback project-apply();
+
+ /// Takes focus back from whatever field holds it. The keyboard scope is
+ /// where focus rests when nothing is being typed into, so giving it the
+ /// focus is what "click beside the field" means; Rust calls this for
+ /// every press a pane reports through Editor.blur.
+ public function blur() {
+ keys.focus();
+ }
+
/// The bottom-right notice: what just happened, said once. Set from Rust
/// and watched by its token — see ToastLayer, which owns the timing.
in property <ToastData> toast;
@@ -221,14 +238,67 @@ export component App inherits Window {
activated => { root.app-menu-selected("redo"); }
}
- // Space plays and pauses, the way it does in every editor. It lands
- // here only when nothing else took it: a field being typed into
- // consumes its own spaces before the key can walk up to this scope.
+ // The rest of the keyboard, the way CapCut lays it out: the chord
+ // key with a letter for an edit, a bare letter for a tool, the
+ // arrows and Home/End for the playhead. Every one lands here only
+ // when nothing else took it - a field being typed into consumes
+ // its own letters and spaces before a key can walk up to this
+ // scope, which is what keeps typing a title from cutting a clip.
key-pressed(event) => {
- if event.text == Key.Space && !root.on-start {
- Editor.play-toggled();
+ if (root.on-start) {
+ return reject;
+ }
+ // The command key arrives as meta on a Mac and as control
+ // everywhere else; either is the chord key.
+ if (event.modifiers.control || event.modifiers.meta) {
+ if (event.modifiers.shift || event.modifiers.alt) {
+ return reject;
+ }
+ if (event.text == "b") { Editor.shortcut("split"); return accept; }
+ if (event.text == "a") { Editor.shortcut("select-all"); return accept; }
+ if (event.text == "c") { Editor.shortcut("copy"); return accept; }
+ if (event.text == "v") { Editor.shortcut("paste"); return accept; }
+ if (event.text == "d") { Editor.shortcut("duplicate"); return accept; }
+ if (event.text == "e") { Editor.shortcut("export"); return accept; }
+ if (event.text == "i") { Editor.shortcut("import"); return accept; }
+ if (event.text == ",") { Editor.shortcut("settings"); return accept; }
+ if (event.text == "=" || event.text == "+") {
+ Editor.shortcut("zoom-in");
+ return accept;
+ }
+ if (event.text == "-") { Editor.shortcut("zoom-out"); return accept; }
+ return reject;
+ }
+ if (event.modifiers.alt) {
+ return reject;
+ }
+ if (event.text == Key.Space) { Editor.play-toggled(); return accept; }
+ if (event.text == Key.Delete || event.text == Key.Backspace) {
+ Editor.delete-selected();
+ return accept;
+ }
+ if (event.text == Key.Home) { Editor.shortcut("start"); return accept; }
+ if (event.text == Key.End) { Editor.shortcut("end"); return accept; }
+ // A frame, or ten with shift.
+ if (event.text == Key.LeftArrow) {
+ Editor.step-frames(event.modifiers.shift ? -10 : -1);
+ return accept;
+ }
+ if (event.text == Key.RightArrow) {
+ Editor.step-frames(event.modifiers.shift ? 10 : 1);
return accept;
}
+ if (event.modifiers.shift) {
+ return reject;
+ }
+ if (event.text == "a" || event.text == "v") {
+ Editor.shortcut("tool-select");
+ return accept;
+ }
+ if (event.text == "b") { Editor.shortcut("tool-razor"); return accept; }
+ if (event.text == "s") { Editor.shortcut("split-selected"); return accept; }
+ if (event.text == "n") { Editor.shortcut("snap"); return accept; }
+ if (event.text == "m") { Editor.shortcut("mute"); return accept; }
return reject;
}
@@ -333,6 +403,20 @@ export component App inherits Window {
model-remove(id) => { root.model-remove(id); }
}
+ ProjectDialog {
+ x: 0;
+ y: 0;
+ width: root.width;
+ height: root.height;
+ data: root.project-sheet;
+
+ closed => { root.project-closed(); }
+ name-edited(name) => { root.project-name-edited(name); }
+ size-changed(index) => { root.project-size-changed(index); }
+ rate-changed(index) => { root.project-rate-changed(index); }
+ apply => { root.project-apply(); }
+ }
+
// Over the workspace and both sheets, under the menus. A tooltip has to
// clear the pane it belongs to — panes clip — and it has no business over
// an open menu, which is the one surface that would rather not be
diff --git a/engine/crates/concat/ui/dialogs/project.slint b/engine/crates/concat/ui/dialogs/project.slint
new file mode 100644
index 00000000..ae4bda25
--- /dev/null
+++ b/engine/crates/concat/ui/dialogs/project.slint
@@ -0,0 +1,109 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+// SPDX-FileCopyrightText: 2026 Jareer and Concat contributors
+
+import { Theme } from "../theme/theme.slint";
+import { Glyph } from "../icons.slint";
+import { Button, DialogRow, DialogSection, Field, Modal } from "../primitives/modal.slint";
+import { Select } from "../primitives/select.slint";
+
+// The project sheet: what the Details panel's Modify button opens.
+//
+// Three facts a project is made of - its name, its frame and its rate - on
+// one short form, applied together. The folder is stated and not editable:
+// a project is its folder, and moving one is a job for the file manager.
+
+export struct ProjectSheetData {
+ open: bool,
+ name: string,
+ folder: string,
+ /// Row in the frame list, or -1 for a size the list does not carry.
+ size: int,
+ /// Row in the rate list.
+ rate: int,
+}
+
+export component ProjectDialog inherits Modal {
+ in property <ProjectSheetData> data;
+
+ callback name-edited(name: string);
+ callback size-changed(index: int);
+ callback rate-changed(index: int);
+ callback apply();
+
+ open: root.data.open;
+ title: "Project";
+ glyph: Glyph.settings;
+ surface-width: 440px;
+
+ VerticalLayout {
+ DialogSection {
+ first: true;
+ title: "Name";
+
+ DialogRow {
+ Field {
+ value: root.data.name;
+ placeholder: "Untitled project";
+ edited(text) => { root.name-edited(text); }
+ }
+ }
+
+ // The folder under the field, whole: the one fact here that
+ // cannot be changed, and the one most worth being able to read.
+ Text {
+ text: root.data.folder;
+ color: Theme.fg-dim;
+ font-family: Theme.font-technical;
+ font-size: Theme.fs-sm;
+ overflow: elide;
+ }
+ }
+
+ DialogSection {
+ title: "Output";
+
+ // The same six frames the monitor's picker offers, in the same
+ // order, so the two controls can never disagree about what a
+ // row means.
+ DialogRow {
+ label: "Frame";
+ Select {
+ current: root.data.size;
+ placeholder: "Custom";
+ options: ["1920 × 1080", "3840 × 2160", "1080 × 1920",
+ "1080 × 1080", "1440 × 1080", "2560 × 1080"];
+ details: ["16:9", "16:9 4K", "9:16", "1:1", "4:3", "21:9"];
+ changed(index) => { root.size-changed(index); }
+ }
+ }
+
+ DialogRow {
+ label: "Frame rate";
+ Select {
+ current: root.data.rate;
+ options: ["24 fps", "25 fps", "29.97 fps", "30 fps", "60 fps"];
+ changed(index) => { root.rate-changed(index); }
+ }
+ }
+ }
+
+ Rectangle {
+ height: 1px;
+ background: Theme.line;
+ }
+
+ VerticalLayout {
+ padding: 14px;
+
+ Button {
+ block: true;
+ primary: true;
+ large: true;
+ glyph: Glyph.check;
+ label: "Apply";
+ enabled: root.data.name != "";
+ clicked => { root.apply(); }
+ }
+ }
+ }
+}
diff --git a/engine/crates/concat/ui/editor.slint b/engine/crates/concat/ui/editor.slint
index 8be83983..3488fbae 100644
--- a/engine/crates/concat/ui/editor.slint
+++ b/engine/crates/concat/ui/editor.slint
@@ -233,4 +233,34 @@ export global Editor {
callback track-sized(index: int, size: TrackSize);
callback track-removed(index: int);
callback track-renamed(index: int, name: string);
+ /// A tab dragged to a new place in the strip. `to` is counted with the
+ /// tab already out of its old slot, the way MoveTimeline counts.
+ callback tab-moved(from: int, to: int);
+
+ // ── the project's facts ──
+ //
+ // What the Details panel reads when nothing is selected. Strings rather
+ // than numbers where the panel would only format them: the panel is a
+ // readout, and Rust already knows how each fact is spelled.
+ in-out property <string> project-name;
+ in-out property <string> project-folder;
+ in-out property <string> project-output;
+ in-out property <string> project-rate;
+ in-out property <string> project-duration;
+ in-out property <int> count-media;
+ in-out property <int> count-tracks;
+ in-out property <int> count-clips;
+ /// The panel's Modify button: open the project sheet.
+ callback modify-project();
+
+ /// A press landed on a pane's floor - a lane, the stage, the bin's
+ /// gutter, a clip. Whatever field had focus gives it up, the way a
+ /// browser's does when you click beside it. Answered by the window,
+ /// which owns the scope the focus falls back to; see App.blur.
+ callback blur();
+
+ /// A keyboard chord that names an edit rather than a view change. One
+ /// callback with a verb rather than one per key, so the window's key
+ /// table and the state's answer to it stay in one place each.
+ callback shortcut(action: string);
}
diff --git a/engine/crates/concat/ui/timeline/lanes.slint b/engine/crates/concat/ui/timeline/lanes.slint
index c14f9ad8..312b5081 100644
--- a/engine/crates/concat/ui/timeline/lanes.slint
+++ b/engine/crates/concat/ui/timeline/lanes.slint
@@ -393,6 +393,8 @@ export component Lanes inherits Rectangle {
in property <length> ruler-height: 28px;
callback scrubbed(seconds: float);
+ /// A press on an empty stretch of lane, before the band it may become.
+ callback floor-pressed();
callback clip-pressed(id: string, additive: bool, edge: int);
callback clip-dragged(seconds: float, pixels: length);
callback clip-released();
@@ -557,6 +559,7 @@ export component Lanes inherits Rectangle {
pointer-event(event) => {
if (event.kind == PointerEventKind.down) {
+ root.floor-pressed();
self.additive = event.modifiers.shift;
self.from-x = self.mouse-x;
self.from-y = self.mouse-y;
diff --git a/engine/crates/concat/ui/timeline/tabs.slint b/engine/crates/concat/ui/timeline/tabs.slint
index fd9966b0..8a7758a3 100644
--- a/engine/crates/concat/ui/timeline/tabs.slint
+++ b/engine/crates/concat/ui/timeline/tabs.slint
@@ -2,6 +2,7 @@
// SPDX-FileCopyrightText: 2026 Jareer and Concat contributors
import { Theme } from "../theme/theme.slint";
+import { Payload } from "../util.slint";
import { Glyph, Icon } from "../icons.slint";
import { TimelineTabData } from "model.slint";
@@ -16,9 +17,10 @@ import { TimelineTabData } from "model.slint";
// the corners. The bar sits away from the content it opens onto, so it reads
// as a label on the tab and not as an underline on the panel.
//
-// Tabs do not drag to reorder. That wants a lifted tab riding the pointer
-// while its neighbours ease aside, which is a whole gesture rather than a
-// detail of this one.
+// Tabs drag to reorder. A lifted tab carries its index the way a bin card
+// carries its row, and the tab it is let go over says which side of itself
+// it landed on; the move itself is the engine's, so undo takes it back like
+// any other edit.
component Tab inherits Rectangle {
in property <string> name;
@@ -182,6 +184,10 @@ export component TimelineTabs inherits Rectangle {
callback renamed(index: int, name: string);
callback close-requested(index: int);
callback added();
+ /// Tab `from` was dropped at `to`, a slot counted over the strip as it
+ /// stands - so `to` may be one past the end, and may sit either side
+ /// of `from` itself. Rust discounts the moving tab.
+ callback moved(from: int, to: int);
height: 32px;
background: Theme.well;
@@ -204,14 +210,63 @@ export component TimelineTabs inherits Rectangle {
for tab[index] in root.tabs: VerticalLayout {
alignment: end;
- Tab {
- name: tab.name;
- current: index == root.current;
- closable: root.tabs.length > 1;
-
- selected => { root.selected(index); }
- renamed(name) => { root.renamed(index, name); }
- close-requested => { root.close-requested(index); }
+
+ // Source and target both. The DragArea only takes over once
+ // the press has travelled, so the tab keeps its click and its
+ // double-click; the DropArea ignores everything but a drag.
+ slot := Rectangle {
+ width: held.width;
+ height: held.height;
+
+ drag := DragArea {
+ data: Payload.of("tab:\{index}:\{tab.name}");
+ drag-image: Payload.preview("tab:\{index}:\{tab.name}");
+ drag-image-offset-x: -8;
+ drag-image-offset-y: -4;
+ allow-copy: true;
+
+ held := Tab {
+ name: tab.name;
+ current: index == root.current;
+ closable: root.tabs.length > 1;
+ // Faded while in the air, as a bin card is.
+ opacity: drag.dragging ? 0.45 : 1.0;
+
+ selected => { root.selected(index); }
+ renamed(name) => { root.renamed(index, name); }
+ close-requested => { root.close-requested(index); }
+ }
+ }
+
+ landing := DropArea {
+ /// The pointer is over the leading half: the tab lands
+ /// before this one rather than after it.
+ property <bool> before;
+
+ can-drop(event) => {
+ self.before = event.position.x < self.width / 2;
+ return Payload.tab-index(Payload.text(event.data)) >= 0
+ && Payload.tab-index(Payload.text(event.data)) != index
+ ? DragAction.copy : DragAction.none;
+ }
+
+ dropped(event) => {
+ root.moved(Payload.tab-index(Payload.text(event.data)),
+ self.before ? index : index + 1);
+ return DragAction.copy;
+ }
+ }
+
+ // Where it will land: a bar on the side it is about to
+ // take, in the accent every other target in the window is
+ // drawn in.
+ if landing.has-drag: Rectangle {
+ x: landing.before ? -2px : parent.width;
+ y: 4px;
+ width: 2px;
+ height: parent.height - 8px;
+ background: Theme.accent;
+ }
}
}
diff --git a/engine/crates/concat/ui/util.slint b/engine/crates/concat/ui/util.slint
index 3d06a9f9..d18f6bfd 100644
--- a/engine/crates/concat/ui/util.slint
+++ b/engine/crates/concat/ui/util.slint
@@ -120,6 +120,9 @@ export global Payload {
/// including a drag from another application, whose payload this tree
/// cannot read. Rust, for want of split(); see `parse-timecode`.
pure callback pane-seat(text: string) -> int;
+
+ /// The tab index in a `tab:N:...` payload, or -1 for anything else.
+ pure callback tab-index(text: string) -> int;
}
export global Geom {
diff --git a/engine/crates/concat/ui/workspace/media-pane.slint b/engine/crates/concat/ui/workspace/media-pane.slint
index 7221cbcc..4ae15964 100644
--- a/engine/crates/concat/ui/workspace/media-pane.slint
+++ b/engine/crates/concat/ui/workspace/media-pane.slint
@@ -546,6 +546,8 @@ component MediaGrid inherits Rectangle {
callback clicked(id: int, additive: bool);
callback activated(id: int);
callback removed(id: int);
+ /// A press on the gutter between the cards, before any band.
+ callback pressed();
/// A marquee closed over the grid, given as the block of cells it caught:
/// the two corners inclusive, and the column count they were measured
/// against. A block and not a list of ids, because the cards are placed by
@@ -623,6 +625,7 @@ component MediaGrid inherits Rectangle {
pointer-event(event) => {
if (event.kind == PointerEventKind.down) {
+ root.pressed();
self.additive = event.modifiers.shift;
self.from-x = self.mouse-x;
self.from-y = self.mouse-y;
@@ -995,6 +998,8 @@ export component MediaPane inherits Rectangle {
callback import-media();
callback filter-changed(filter: MediaFilter);
+ /// A press on the bin's floor; see Editor.blur.
+ callback floor-pressed();
callback select(id: int, additive: bool);
/// A marquee closed over the card grid — see MediaGrid.band-selected.
callback band-selected(columns: int, from-col: int, to-col: int,
@@ -1548,6 +1553,7 @@ export component MediaPane inherits Rectangle {
page-floor: Math.max(0px, pages.height - 52px
- (root.selected-count > 1 ? 36px : 0px) - 8px);
+ pressed => { root.floor-pressed(); }
clicked(id, additive) => { root.select(id, additive); }
activated(id) => { root.activate(id); }
removed(id) => { root.remove(id); }
diff --git a/engine/crates/concat/ui/workspace/seat.slint b/engine/crates/concat/ui/workspace/seat.slint
index b624c92d..3b2375a3 100644
--- a/engine/crates/concat/ui/workspace/seat.slint
+++ b/engine/crates/concat/ui/workspace/seat.slint
@@ -102,7 +102,11 @@ export component Seat inherits Rectangle {
import-media => { Editor.import-media(); }
filter-changed(filter) => { Editor.media-filter-changed(filter); }
- select(id, additive) => { Editor.media-select(id, additive); }
+ floor-pressed => { Editor.blur(); }
+ select(id, additive) => {
+ Editor.blur();
+ Editor.media-select(id, additive);
+ }
band-selected(columns, from-col, to-col, from-row, to-row, additive) => {
Editor.media-band-selected(columns, from-col, to-col,
from-row, to-row, additive);
@@ -149,8 +153,12 @@ export component Seat inherits Rectangle {
step(frames) => { Editor.step-frames(frames); }
ratio-changed(index) => { Editor.ratio-changed(index); }
quality-changed(index) => { Editor.quality-changed(index); }
- stage-pressed(x, y, additive) => { Editor.stage-pressed(x, y, additive); }
+ stage-pressed(x, y, additive) => {
+ Editor.blur();
+ Editor.stage-pressed(x, y, additive);
+ }
stage-grip-pressed(id, grip, x, y) => {
+ Editor.blur();
Editor.stage-grip-pressed(id, grip, x, y);
}
stage-dragged(x, y, snap) => { Editor.stage-dragged(x, y, snap); }
@@ -198,6 +206,16 @@ export component Seat inherits Rectangle {
Editor.chain-set-param(audio, index, key, value);
}
+ project-name: Editor.project-name;
+ project-folder: Editor.project-folder;
+ project-output: Editor.project-output;
+ project-rate: Editor.project-rate;
+ project-duration: Editor.project-duration;
+ count-media: Editor.count-media;
+ count-tracks: Editor.count-tracks;
+ count-clips: Editor.count-clips;
+ modify-project => { Editor.modify-project(); }
+
selected: Editor.selected-clip;
clip-set(field, value) => { Editor.clip-set(field, value); }
clip-set-text(field, value) => { Editor.clip-set-text(field, value); }
@@ -269,6 +287,7 @@ export component Seat inherits Rectangle {
tab-renamed(index, name) => { Editor.tab-renamed(index, name); }
tab-close-requested(index) => { Editor.tab-close-requested(index); }
tab-added => { Editor.tab-added(); }
+ tab-moved(from, to) => { Editor.tab-moved(from, to); }
tool-changed(tool) => { Editor.tool-changed(tool); }
snap-changed(snap) => { Editor.snap-changed(snap); }
split => { Editor.split(); }
@@ -282,8 +301,15 @@ export component Seat inherits Rectangle {
add-track => { Editor.add-track(); }
zoom-to-fit(width) => { Editor.zoom-to-fit(width); }
zoom(factor, anchor) => { Editor.zoom(factor, anchor); }
- scrubbed(seconds) => { Editor.scrubbed(seconds); }
- clip-pressed(id, additive, edge) => { Editor.clip-pressed(id, additive, edge); }
+ floor-pressed => { Editor.blur(); }
+ scrubbed(seconds) => {
+ Editor.blur();
+ Editor.scrubbed(seconds);
+ }
+ clip-pressed(id, additive, edge) => {
+ Editor.blur();
+ Editor.clip-pressed(id, additive, edge);
+ }
clip-dragged(seconds, pixels) => { Editor.clip-dragged(seconds, pixels); }
clip-released => { Editor.clip-released(); }
razored(id, seconds) => { Editor.razored(id, seconds); }
diff --git a/engine/crates/concat/ui/workspace/timeline-pane.slint b/engine/crates/concat/ui/workspace/timeline-pane.slint
index ad53f5e6..00984c17 100644
--- a/engine/crates/concat/ui/workspace/timeline-pane.slint
+++ b/engine/crates/concat/ui/workspace/timeline-pane.slint
@@ -31,6 +31,7 @@ export component TimelinePane inherits Rectangle {
callback tab-renamed(index: int, name: string);
callback tab-close-requested(index: int);
callback tab-added();
+ callback tab-moved(from: int, to: int);
// ── the tray ─────────────────────────────────────────────────────────
in property <TimelineTool> tool: TimelineTool.select;
@@ -76,6 +77,8 @@ export component TimelinePane inherits Rectangle {
in-out property <length> track-scroll;
callback scrubbed(seconds: float);
+ /// A press on an empty stretch of lane; see Editor.blur.
+ callback floor-pressed();
callback clip-pressed(id: string, additive: bool, edge: int);
callback clip-dragged(seconds: float, pixels: length);
callback clip-released();
@@ -172,6 +175,7 @@ export component TimelinePane inherits Rectangle {
renamed(index, name) => { root.tab-renamed(index, name); }
close-requested(index) => { root.tab-close-requested(index); }
added => { root.tab-added(); }
+ moved(from, to) => { root.tab-moved(from, to); }
PaneSwitcher {
kind: PaneKind.timeline;
@@ -287,6 +291,7 @@ export component TimelinePane inherits Rectangle {
ruler-height: root.ruler-height;
scrubbed(seconds) => { root.scrubbed(seconds); }
+ floor-pressed => { root.floor-pressed(); }
clip-pressed(id, additive, edge) => { root.clip-pressed(id, additive, edge); }
clip-dragged(seconds, pixels) => { root.clip-dragged(seconds, pixels); }
clip-released => { root.clip-released(); }