Skip to content

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

feat(inspector): the sections inside a tab are marks and words on the panel, with a bar under the open one

Jareerbb30386b3efa
diff --git a/src/crates/concat/ui/icons.slint b/src/crates/concat/ui/icons.slint
index f72463e6..1881d4dd 100644
--- a/src/crates/concat/ui/icons.slint
+++ b/src/crates/concat/ui/icons.slint
@@ -165,6 +165,11 @@ export enum Glyph {
// the cutout's brushes
brush,
eraser,
+ // the inspector's sections: where a clip sits, what makes it better,
+ // and its colour's knobs
+ move,
+ wand,
+ sliders,
}
component Stroked inherits Path {
@@ -413,6 +418,26 @@ export component Icon inherits Rectangle {
commands: "M21 21l-4.34-4.34 M3 11a8 8 0 1 0 16 0a8 8 0 1 0 -16 0";
}
+ // lucide/move
+ if root.glyph == Glyph.move: Stroked {
+ size: root.size; tint: root.tint; weight: root.weight;
+ commands: "M12 2v20 M15 19l-3 3-3-3 M19 9l3 3-3 3 M2 12h20 M5 9l-3 3 3 3 M9 5l3-3 3 3";
+ }
+
+ // lucide/wand-sparkles
+ if root.glyph == Glyph.wand: Stroked {
+ size: root.size; tint: root.tint; weight: root.weight;
+ commands: "M21.64 3.64l-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72"
+ + "l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72"
+ + " M14 7l3 3 M5 6v4 M19 14v4 M10 2v2 M7 8H3 M21 16h-4 M11 3H9";
+ }
+
+ // lucide/sliders-horizontal
+ if root.glyph == Glyph.sliders: Stroked {
+ size: root.size; tint: root.tint; weight: root.weight;
+ commands: "M21 4H14 M10 4H3 M21 12H12 M8 12H3 M21 20H16 M12 20H3 M14 2V6 M8 10V14 M16 18V22";
+ }
+
// lucide/sparkles
if root.glyph == Glyph.sparkle: Stroked {
size: root.size; tint: root.tint; weight: root.weight;
diff --git a/src/crates/concat/ui/primitives/section-tabs.slint b/src/crates/concat/ui/primitives/section-tabs.slint
new file mode 100644
index 00000000..bb69e88a
--- /dev/null
+++ b/src/crates/concat/ui/primitives/section-tabs.slint
@@ -0,0 +1,131 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+// SPDX-FileCopyrightText: 2026 Jareer Abdullah and Concat contributors
+
+import { Theme } from "../theme/theme.slint";
+import { Glyph, Icon } from "../icons.slint";
+import { FocusRing } from "focus-ring.slint";
+
+// The inspector's sections, inside a tab: a row of marks and words on the
+// panel itself, with no track of its own, and a bar under the one that is
+// open. It reads as a place within the tab rather than a second set of
+// tabs, which a second filled segmented control above the panel did - two
+// dark tracks stacked, one choosing the other.
+//
+// The segments share the width equally, so the bar's place is computed
+// from the count rather than measured from the labels.
+export component SectionTabs inherits Rectangle {
+ in property <[string]> options;
+ /// A glyph per option, in the same order, worn before its word.
+ in property <[Glyph]> icons;
+ in-out property <int> current;
+
+ callback changed(index: int);
+
+ property <bool> ring;
+ property <length> seg-w: root.width / Math.max(root.options.length, 1);
+
+ min-width: 120px;
+ horizontal-stretch: 1;
+
+ function select(index: int) {
+ if (index >= 0 && index < root.options.length) {
+ root.current = index;
+ root.changed(index);
+ }
+ }
+
+ fs := FocusScope {
+ // :focus-visible — keyboard focus only, see IconButton.
+ focus-gained(reason) => {
+ root.ring = reason == FocusReason.tab-navigation;
+ }
+ focus-lost(reason) => {
+ root.ring = false;
+ }
+ key-pressed(event) => {
+ if (event.text == Key.RightArrow || event.text == Key.DownArrow) {
+ root.select(Math.mod(root.current + 1, root.options.length));
+ return EventResult.accept;
+ }
+ if (event.text == Key.LeftArrow || event.text == Key.UpArrow) {
+ root.select(Math.mod(root.current - 1 + root.options.length, root.options.length));
+ return EventResult.accept;
+ }
+ return EventResult.reject;
+ }
+ }
+
+ for option[index] in root.options: tab := Rectangle {
+ property <bool> on: index == root.current;
+ property <brush> ink: self.on ? Theme.fg : segment.has-hover ? Theme.fg : Theme.fg-muted;
+
+ x: index * root.seg-w;
+ y: 0;
+ width: root.seg-w;
+ height: root.height;
+
+ // A soft wash under the pointer, inset from the strip's edges so
+ // neighbours never touch.
+ Rectangle {
+ x: 3px;
+ y: 5px;
+ width: parent.width - 6px;
+ height: parent.height - 10px;
+ border-radius: Theme.r-sm;
+ background: segment.has-hover && !tab.on ? Theme.field-hover : transparent;
+
+ animate background { duration: 120ms; }
+ }
+
+ HorizontalLayout {
+ alignment: center;
+ spacing: 6px;
+ padding-left: 6px;
+ padding-right: 6px;
+
+ if index < root.icons.length: VerticalLayout {
+ alignment: center;
+ Icon {
+ glyph: root.icons[index];
+ size: 14px;
+ tint: tab.ink;
+ }
+ }
+ Text {
+ text: option;
+ color: tab.ink;
+ font-size: Theme.fs;
+ font-weight: tab.on ? Theme.weight-title : 400;
+ vertical-alignment: center;
+ overflow: elide;
+
+ animate color { duration: 140ms; easing: cubic-bezier(0.4, 0, 0.2, 1); }
+ }
+ }
+
+ segment := TouchArea {
+ mouse-cursor: pointer;
+ clicked => {
+ fs.focus();
+ root.select(index);
+ }
+ }
+ }
+
+ // The open section's bar, sitting on the strip's bottom hairline.
+ Rectangle {
+ x: root.current * root.seg-w + 12px;
+ y: root.height - 2px;
+ width: root.seg-w - 24px;
+ height: 2px;
+ border-radius: 1px;
+ background: Theme.accent;
+
+ animate x, width { duration: 180ms; easing: cubic-bezier(0.4, 0, 0.2, 1); }
+ }
+
+ FocusRing {
+ active: root.ring;
+ radius: Theme.r;
+ }
+}
diff --git a/src/crates/concat/ui/workspace/config-pane.slint b/src/crates/concat/ui/workspace/config-pane.slint
index fa05b8b7..6dc63bbf 100644
--- a/src/crates/concat/ui/workspace/config-pane.slint
+++ b/src/crates/concat/ui/workspace/config-pane.slint
@@ -3,6 +3,8 @@
import { I18n } from "../i18n.slint";
import { Theme, SegmentedControl } from "../primitives/primitives.slint";
+import { SectionTabs } from "../primitives/section-tabs.slint";
+import { Glyph } from "../icons.slint";
import { Select } from "../primitives/select.slint";
import { Pane, PaneBody, PaneScroll } from "pane.slint";
import { PaneKind, PaneSwitcher } from "pane-switcher.slint";
@@ -294,6 +296,16 @@ export component ConfigPane inherits Rectangle {
: root.heading == "Effects" ? ["Effects"]
: root.heading == "Text" ? ["Text"]
: ["Layer", "Adjust", "Effects"];
+ /// A mark for each section, in the same order: where the clip sits,
+ /// what makes it better, its colour's knobs; its level and its sound's
+ /// chain; a layer's own strength, then its colour and its chain.
+ property <[Glyph]> section-icons: root.heading == "Video"
+ ? (root.is-shape ? [Glyph.move] : [Glyph.move, Glyph.wand, Glyph.sliders])
+ : root.heading == "Audio"
+ ? (root.selected.batch-volume ? [Glyph.volume] : [Glyph.volume, Glyph.waveform])
+ : root.heading == "Effects" ? [Glyph.sparkle]
+ : root.heading == "Text" ? [Glyph.text-mark]
+ : [Glyph.filter, Glyph.sliders, Glyph.sparkle];
/// The sections as the dropdown shows them; see `tabs-shown`.
property <[string]> sections-shown: root.heading == "Video"
? (root.is-shape ? [I18n.t("configPane.basic")]
@@ -599,9 +611,10 @@ export component ConfigPane inherits Rectangle {
}
}
- // The tab's sections, as a second strip under the first, in the
- // same segmented style. One section needs no strip: the tab already
- // says where you are.
+ // The tab's sections, as a strip of marks and words under the
+ // tabs: on the panel itself, so it reads as a place inside the tab
+ // and not a second row of tabs. One section needs no strip: the tab
+ // already says where you are.
if root.has-selection && root.sections.length > 1: Rectangle {
height: 40px;
background: Theme.panel;
@@ -615,12 +628,12 @@ export component ConfigPane inherits Rectangle {
}
HorizontalLayout {
- padding-left: 8px;
- padding-right: 8px;
+ padding-left: 4px;
+ padding-right: 4px;
VerticalLayout {
- alignment: center;
- SegmentedControl {
+ SectionTabs {
options: root.sections-shown;
+ icons: root.section-icons;
// A press on a segment assigns `current` inside the
// control, which ends a plain binding here: the
// highlight then stayed where it was pressed while