Skip to content

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

feat(ui): search fields let go on Enter and Esc; the search field and the effect tiles are soft surfaces

Jareer0a45c5a58a4a
diff --git a/src/crates/concat/ui/inspector/clip-inspector.slint b/src/crates/concat/ui/inspector/clip-inspector.slint
index 7b7787a4..369f697a 100644
--- a/src/crates/concat/ui/inspector/clip-inspector.slint
+++ b/src/crates/concat/ui/inspector/clip-inspector.slint
@@ -263,10 +263,10 @@ export component PresetStack inherits VerticalLayout {
// enough that a shelf of twenty is four rows rather than seven.
property <int> columns: 3;
property <length> pad: Theme.pad;
- property <length> cell-gap: 6px;
+ property <length> cell-gap: 8px;
property <length> cell-w: (root.width - 2 * root.pad
- (root.columns - 1) * root.cell-gap) / root.columns;
- property <length> cell-h: 58px;
+ property <length> cell-h: 64px;
property <int> rows: ceil(root.catalogue.length / root.columns);
/// Links that belong to another section's controls - the audio
@@ -621,14 +621,15 @@ export component PresetStack inherits VerticalLayout {
y: floor(index / root.columns) * (root.cell-h + root.cell-gap);
width: root.cell-w;
height: root.cell-h;
- border-radius: Theme.r-sm;
+ // Borderless surfaces rather than drawn boxes: the grid reads
+ // as one shelf, and the one on the clip is the one that
+ // stands out, tinted and outlined in the accent.
+ border-radius: Theme.r;
border-width: 1px;
- border-color: tile.in-chain ? Theme.accent
- : tile-touch.has-hover ? Theme.line-strong
- : Theme.line;
+ border-color: tile.in-chain ? Theme.accent : Colors.transparent;
background: tile.in-chain ? Theme.accent-soft
- : tile-touch.has-hover ? Theme.field-hover
- : Theme.field;
+ : tile-touch.has-hover ? Theme.field
+ : Theme.raised;
animate background, border-color {
duration: 100ms;
@@ -646,15 +647,27 @@ export component PresetStack inherits VerticalLayout {
HorizontalLayout {
alignment: center;
- Icon {
- glyph: tile.in-chain ? Glyph.check
- : entry.category == "Voice" ? Glyph.mic
- : entry.category == "Tone" ? Glyph.sliders
- : entry.category == "Clean" ? Glyph.wand
- : Glyph.waveform;
- size: 15px;
- tint: tile.in-chain ? Theme.accent
- : tile-touch.has-hover ? Theme.fg : Theme.fg-muted;
+ // The mark in a round badge of its own, which fills
+ // with the accent once the effect is on the clip.
+ Rectangle {
+ width: 28px;
+ height: 28px;
+ border-radius: 14px;
+ background: tile.in-chain ? Theme.accent
+ : tile-touch.has-hover ? Theme.field-active : Theme.field;
+
+ animate background { duration: 120ms; }
+
+ Icon {
+ glyph: tile.in-chain ? Glyph.check
+ : entry.category == "Voice" ? Glyph.mic
+ : entry.category == "Tone" ? Glyph.sliders
+ : entry.category == "Clean" ? Glyph.wand
+ : Glyph.waveform;
+ size: 14px;
+ tint: tile.in-chain ? Theme.on-accent
+ : tile-touch.has-hover ? Theme.fg : Theme.fg-muted;
+ }
}
}
diff --git a/src/crates/concat/ui/inspector/controls.slint b/src/crates/concat/ui/inspector/controls.slint
index 189b885d..fd82aef0 100644
--- a/src/crates/concat/ui/inspector/controls.slint
+++ b/src/crates/concat/ui/inspector/controls.slint
@@ -3,7 +3,7 @@
import { I18n } from "../i18n.slint";
import { Theme } from "../theme/theme.slint";
-import { Fmt } from "../util.slint";
+import { Fmt, Focus } from "../util.slint";
import { Glyph, Icon } from "../icons.slint";
import { NumberField } from "../primitives/number-field.slint";
import { ColorPicker } from "../primitives/color-picker.slint";
@@ -712,23 +712,35 @@ export component SearchField inherits Rectangle {
// A caller's `focus()` lands in the field, so a list that opens on a
// search can be typed into at once.
forward-focus: input;
- height: Theme.h;
- border-radius: Theme.r-sm;
- background: Theme.field;
+ height: Theme.h + 4px;
+ border-radius: Theme.r;
+ // A soft surface at rest, lifting under the pointer, outlined only
+ // while it is being typed into: a box drawn round an empty field
+ // shouted louder than anything in the list it searches.
+ background: input.has-focus || hover.has-hover ? Theme.field : Theme.raised;
border-width: 1px;
- border-color: input.has-focus ? Theme.accent : Theme.line;
+ border-color: input.has-focus ? Theme.accent : Colors.transparent;
+
+ animate background, border-color { duration: 120ms; easing: cubic-bezier(0.4, 0, 0.2, 1); }
+
+ // Under everything, so the pointer can light the field without taking
+ // a click from the input or the clear button.
+ hover := TouchArea {
+ mouse-cursor: MouseCursor.text;
+ clicked => { input.focus(); }
+ }
HorizontalLayout {
- padding-left: 8px;
- padding-right: 4px;
- spacing: 6px;
+ padding-left: 10px;
+ padding-right: 6px;
+ spacing: 8px;
VerticalLayout {
alignment: center;
Icon {
glyph: Glyph.search;
- size: 12px;
- tint: Theme.fg-dim;
+ size: 13px;
+ tint: input.has-focus ? Theme.fg : Theme.fg-dim;
}
}
@@ -745,6 +757,17 @@ export component SearchField inherits Rectangle {
single-line: true;
text <=> root.text;
edited => { root.edited(self.text); }
+ // Enter and Esc are done typing, as on the web: the field lets
+ // go and the window's shortcuts have their keys back. The
+ // words stay; the cross clears them.
+ accepted => { Focus.release(); }
+ key-pressed(event) => {
+ if (event.text == Key.Escape) {
+ Focus.release();
+ return EventResult.accept;
+ }
+ return EventResult.reject;
+ }
}
if root.text == "" && !input.has-focus: Text {