Skip to content

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

fix(ui): centre text in its control, and give the tray and lanes their space back

Jareer05c7003268f7
diff --git a/engine/crates/concat/locales/de.json b/engine/crates/concat/locales/de.json
index 3e113b5a..0c9298e7 100644
--- a/engine/crates/concat/locales/de.json
+++ b/engine/crates/concat/locales/de.json
@@ -131,7 +131,6 @@
"Delete {0} clips": "{0} Clips löschen",
"Depth": "Tiefe",
"Destination": "Ziel",
- "Detach audio": "Ton trennen",
"DETAILS": "DETAILS",
"Distort": "Verzerren",
"Distorted": "Verzerrt",
@@ -366,7 +365,6 @@
"Rate re-times the clip in place, so the timeline length changes with it. Trim afterwards, not before. A curve varies the rate over the clip; the same footage plays, faster here and slower there.": "Rate ändert das Tempo des Clips an Ort und Stelle, die Länge auf der Zeitleiste ändert sich mit. Erst danach kürzen. Eine Kurve verändert die Rate über den Clip; dasselbe Material läuft, hier schneller und dort langsamer.",
"Razor (B)": "Rasierklinge (B)",
"Read this title aloud": "Diesen Titel vorlesen",
- "Reattach": "Wieder verbinden",
"Recent": "Zuletzt",
"Recommended": "Empfohlen",
"Redo": "Wiederholen",
@@ -438,7 +436,6 @@
"Sound": "Ton",
"Space": "Raum",
"Spanish": "Spanisch",
- "Speak": "Sprechen",
"Speech": "Sprache",
"Speed": "Tempo",
"Spin": "Drehen",
diff --git a/engine/crates/concat/locales/en.json b/engine/crates/concat/locales/en.json
index 9c9bc42f..0f4ab5f0 100644
--- a/engine/crates/concat/locales/en.json
+++ b/engine/crates/concat/locales/en.json
@@ -167,7 +167,6 @@
"Delete {0} clips": "Delete {0} clips",
"Depth": "Depth",
"Destination": "Destination",
- "Detach audio": "Detach audio",
"Detail": "Detail",
"DETAILS": "DETAILS",
"Digicam": "Digicam",
@@ -471,7 +470,6 @@
"Razor (B)": "Razor (B)",
"Read a script aloud at the playhead": "Read a script aloud at the playhead",
"Read this title aloud": "Read this title aloud",
- "Reattach": "Reattach",
"Recent": "Recent",
"Recommended": "Recommended",
"Red and blue pulled apart, the colour fringing of a cheap lens.": "Red and blue pulled apart, the colour fringing of a cheap lens.",
@@ -567,7 +565,6 @@
"Source": "Source",
"Space": "Space",
"Spanish": "Spanish",
- "Speak": "Speak",
"Speech": "Speech",
"Speed": "Speed",
"Spin": "Spin",
diff --git a/engine/crates/concat/locales/es.json b/engine/crates/concat/locales/es.json
index d2b6c575..8efe131b 100644
--- a/engine/crates/concat/locales/es.json
+++ b/engine/crates/concat/locales/es.json
@@ -131,7 +131,6 @@
"Delete {0} clips": "Eliminar {0} clips",
"Depth": "Profundidad",
"Destination": "Destino",
- "Detach audio": "Separar audio",
"DETAILS": "DETALLES",
"Distort": "Distorsión",
"Distorted": "Distorsionado",
@@ -366,7 +365,6 @@
"Rate re-times the clip in place, so the timeline length changes with it. Trim afterwards, not before. A curve varies the rate over the clip; the same footage plays, faster here and slower there.": "La velocidad cambia el ritmo del clip en su sitio, así que su duración en la línea de tiempo cambia con ella. Recorta después, no antes. Una curva varía la velocidad a lo largo del clip: el mismo metraje se reproduce más rápido aquí y más lento allá.",
"Razor (B)": "Cuchilla (B)",
"Read this title aloud": "Leer este título en voz alta",
- "Reattach": "Volver a unir",
"Recent": "Recientes",
"Recommended": "Recomendada",
"Redo": "Rehacer",
@@ -438,7 +436,6 @@
"Sound": "Sonido",
"Space": "Espacio",
"Spanish": "Español",
- "Speak": "Hablar",
"Speech": "Voz",
"Speed": "Velocidad",
"Spin": "Giro",
diff --git a/engine/crates/concat/locales/fr.json b/engine/crates/concat/locales/fr.json
index fe4e14a6..7b04ca51 100644
--- a/engine/crates/concat/locales/fr.json
+++ b/engine/crates/concat/locales/fr.json
@@ -131,7 +131,6 @@
"Delete {0} clips": "Supprimer {0} clips",
"Depth": "Profondeur",
"Destination": "Destination",
- "Detach audio": "Détacher l'audio",
"DETAILS": "DÉTAILS",
"Distort": "Distorsion",
"Distorted": "Distordu",
@@ -366,7 +365,6 @@
"Rate re-times the clip in place, so the timeline length changes with it. Trim afterwards, not before. A curve varies the rate over the clip; the same footage plays, faster here and slower there.": "La vitesse rythme le clip sur place, sa durée sur la timeline change donc avec elle. Rognez après, pas avant. Une courbe fait varier la vitesse le long du clip : les mêmes images passent, plus vite ici et plus lentement là.",
"Razor (B)": "Lame (B)",
"Read this title aloud": "Lire ce titre à voix haute",
- "Reattach": "Rattacher",
"Recent": "Récents",
"Recommended": "Recommandée",
"Redo": "Rétablir",
@@ -438,7 +436,6 @@
"Sound": "Son",
"Space": "Espace",
"Spanish": "Espagnol",
- "Speak": "Parler",
"Speech": "Voix",
"Speed": "Vitesse",
"Spin": "Rotation",
diff --git a/engine/crates/concat/locales/hr.json b/engine/crates/concat/locales/hr.json
index 9a1eee77..9ae6fa5c 100644
--- a/engine/crates/concat/locales/hr.json
+++ b/engine/crates/concat/locales/hr.json
@@ -165,7 +165,6 @@
"Delete {0} clips": "Obriši {0} klipova",
"Depth": "Dubina",
"Destination": "Odredište",
- "Detach audio": "Odvoji zvuk",
"Detail": "Detalj",
"DETAILS": "POJEDINOSTI",
"Digicam": "Digicam",
@@ -465,7 +464,6 @@
"Razor (B)": "Žilet (B)",
"Read a script aloud at the playhead": "Pročitajte skriptu naglas na playheadu",
"Read this title aloud": "Pročitajte ovaj naslov naglas",
- "Reattach": "Ponovno spoji",
"Recent": "Nedavno",
"Recommended": "Preporučeno",
"Red and blue pulled apart, the colour fringing of a cheap lens.": "Crvena i plava razdvojene, kolorni rub jeftinog objektiva.",
@@ -555,7 +553,6 @@
"Source": "Izvor",
"Space": "Prostor",
"Spanish": "španjolski",
- "Speak": "Govori",
"Speech": "Govor",
"Speed": "Brzina",
"Spin": "Vrtnja",
@@ -679,4 +676,4 @@
"Sort: Added": "Sort: Added",
"Sort: Name": "Sort: Name",
"Sort: Type": "Sort: Type"
-}
\ No newline at end of file
+}
diff --git a/engine/crates/concat/locales/it.json b/engine/crates/concat/locales/it.json
index d830094b..4d844607 100644
--- a/engine/crates/concat/locales/it.json
+++ b/engine/crates/concat/locales/it.json
@@ -131,7 +131,6 @@
"Delete {0} clips": "Elimina {0} clip",
"Depth": "Profondità",
"Destination": "Destinazione",
- "Detach audio": "Separa audio",
"DETAILS": "DETTAGLI",
"Distort": "Distorsione",
"Distorted": "Distorto",
@@ -366,7 +365,6 @@
"Rate re-times the clip in place, so the timeline length changes with it. Trim afterwards, not before. A curve varies the rate over the clip; the same footage plays, faster here and slower there.": "La velocità ricalcola i tempi della clip sul posto, quindi la durata sulla timeline cambia con essa. Accorcia dopo, non prima. Una curva varia la velocità lungo la clip: la stessa ripresa scorre, più veloce qui e più lenta là.",
"Razor (B)": "Lametta (B)",
"Read this title aloud": "Leggi questo titolo ad alta voce",
- "Reattach": "Ricollega",
"Recent": "Recenti",
"Recommended": "Consigliata",
"Redo": "Ripeti",
@@ -438,7 +436,6 @@
"Sound": "Suono",
"Space": "Spazio",
"Spanish": "Spagnolo",
- "Speak": "Parla",
"Speech": "Voce",
"Speed": "Velocità",
"Spin": "Rotazione",
diff --git a/engine/crates/concat/locales/ja.json b/engine/crates/concat/locales/ja.json
index 8b009dba..d0c13be6 100644
--- a/engine/crates/concat/locales/ja.json
+++ b/engine/crates/concat/locales/ja.json
@@ -131,7 +131,6 @@
"Delete {0} clips": "{0} 個のクリップを削除",
"Depth": "深さ",
"Destination": "保存先",
- "Detach audio": "オーディオを分離",
"DETAILS": "詳細",
"Distort": "ディストーション",
"Distorted": "ディストーション",
@@ -366,7 +365,6 @@
"Rate re-times the clip in place, so the timeline length changes with it. Trim afterwards, not before. A curve varies the rate over the clip; the same footage plays, faster here and slower there.": "速度はクリップをその場でリタイムするため、タイムライン上の長さも変わります。トリミングは前ではなく後で。カーブはクリップ内で速度を変化させ、同じ映像がここでは速く、そこでは遅く再生されます。",
"Razor (B)": "レーザー (B)",
"Read this title aloud": "このタイトルを読み上げる",
- "Reattach": "再結合",
"Recent": "最近",
"Recommended": "推奨",
"Redo": "やり直す",
@@ -438,7 +436,6 @@
"Sound": "サウンド",
"Space": "空間",
"Spanish": "スペイン語",
- "Speak": "読み上げ",
"Speech": "音声",
"Speed": "速度",
"Spin": "スピン",
diff --git a/engine/crates/concat/locales/ko.json b/engine/crates/concat/locales/ko.json
index cd66744c..5a282905 100644
--- a/engine/crates/concat/locales/ko.json
+++ b/engine/crates/concat/locales/ko.json
@@ -131,7 +131,6 @@
"Delete {0} clips": "클립 {0}개 삭제",
"Depth": "깊이",
"Destination": "대상",
- "Detach audio": "오디오 분리",
"DETAILS": "세부 정보",
"Distort": "왜곡",
"Distorted": "왜곡",
@@ -366,7 +365,6 @@
"Rate re-times the clip in place, so the timeline length changes with it. Trim afterwards, not before. A curve varies the rate over the clip; the same footage plays, faster here and slower there.": "속도는 클립을 제자리에서 다시 타이밍하므로 타임라인 길이도 함께 바뀝니다. 다듬기는 나중에 하세요. 곡선은 클립 안에서 속도를 바꿉니다. 같은 영상이 여기서는 빠르게, 저기서는 느리게 재생됩니다.",
"Razor (B)": "면도칼 (B)",
"Read this title aloud": "이 자막 읽어 주기",
- "Reattach": "다시 붙이기",
"Recent": "최근",
"Recommended": "권장",
"Redo": "다시 실행",
@@ -438,7 +436,6 @@
"Sound": "사운드",
"Space": "공간",
"Spanish": "스페인어",
- "Speak": "읽어 주기",
"Speech": "음성",
"Speed": "속도",
"Spin": "회전",
diff --git a/engine/crates/concat/locales/pt-BR.json b/engine/crates/concat/locales/pt-BR.json
index 552b66d2..91fea308 100644
--- a/engine/crates/concat/locales/pt-BR.json
+++ b/engine/crates/concat/locales/pt-BR.json
@@ -131,7 +131,6 @@
"Delete {0} clips": "Excluir {0} clipes",
"Depth": "Profundidade",
"Destination": "Destino",
- "Detach audio": "Separar áudio",
"DETAILS": "DETALHES",
"Distort": "Distorção",
"Distorted": "Distorcido",
@@ -366,7 +365,6 @@
"Rate re-times the clip in place, so the timeline length changes with it. Trim afterwards, not before. A curve varies the rate over the clip; the same footage plays, faster here and slower there.": "A velocidade altera o tempo do clipe no lugar, então a duração na linha do tempo muda junto. Apare depois, não antes. Uma curva varia a velocidade ao longo do clipe: a mesma imagem passa, mais rápido aqui e mais devagar ali.",
"Razor (B)": "Lâmina (B)",
"Read this title aloud": "Ler este título em voz alta",
- "Reattach": "Reanexar",
"Recent": "Recentes",
"Recommended": "Recomendada",
"Redo": "Refazer",
@@ -438,7 +436,6 @@
"Sound": "Som",
"Space": "Espaço",
"Spanish": "Espanhol",
- "Speak": "Falar",
"Speech": "Fala",
"Speed": "Velocidade",
"Spin": "Giro",
diff --git a/engine/crates/concat/locales/ru.json b/engine/crates/concat/locales/ru.json
index e44bdc0e..56c67666 100644
--- a/engine/crates/concat/locales/ru.json
+++ b/engine/crates/concat/locales/ru.json
@@ -131,7 +131,6 @@
"Delete {0} clips": "Удалить клипы: {0}",
"Depth": "Глубина",
"Destination": "Назначение",
- "Detach audio": "Отделить звук",
"DETAILS": "СВЕДЕНИЯ",
"Distort": "Искажение",
"Distorted": "Искажённый",
@@ -366,7 +365,6 @@
"Rate re-times the clip in place, so the timeline length changes with it. Trim afterwards, not before. A curve varies the rate over the clip; the same footage plays, faster here and slower there.": "Скорость меняет темп клипа на месте, так что его длина на таймлайне меняется вместе с ней. Подрезайте после, а не до. Кривая меняет скорость по ходу клипа: тот же материал идёт быстрее здесь и медленнее там.",
"Razor (B)": "Лезвие (B)",
"Read this title aloud": "Прочитать этот титр вслух",
- "Reattach": "Присоединить обратно",
"Recent": "Недавние",
"Recommended": "Рекомендуется",
"Redo": "Повторить",
@@ -438,7 +436,6 @@
"Sound": "Звук",
"Space": "Пространство",
"Spanish": "Испанский",
- "Speak": "Озвучить",
"Speech": "Речь",
"Speed": "Скорость",
"Spin": "Вращение",
diff --git a/engine/crates/concat/locales/tr.json b/engine/crates/concat/locales/tr.json
index 3b953b68..3789e874 100644
--- a/engine/crates/concat/locales/tr.json
+++ b/engine/crates/concat/locales/tr.json
@@ -131,7 +131,6 @@
"Delete {0} clips": "{0} klibi sil",
"Depth": "Derinlik",
"Destination": "Hedef",
- "Detach audio": "Sesi ayır",
"DETAILS": "AYRINTILAR",
"Distort": "Bozma",
"Distorted": "Bozulmuş",
@@ -366,7 +365,6 @@
"Rate re-times the clip in place, so the timeline length changes with it. Trim afterwards, not before. A curve varies the rate over the clip; the same footage plays, faster here and slower there.": "Hız klibi yerinde yeniden zamanlar, bu yüzden zaman çizelgesindeki uzunluk da değişir. Önce değil, sonra kırpın. Bir eğri hızı klip boyunca değiştirir; aynı görüntü burada hızlı, orada yavaş oynar.",
"Razor (B)": "Jilet (B)",
"Read this title aloud": "Bu yazıyı sesli oku",
- "Reattach": "Yeniden bağla",
"Recent": "Son kullanılanlar",
"Recommended": "Önerilen",
"Redo": "Yinele",
@@ -438,7 +436,6 @@
"Sound": "Ses",
"Space": "Mekân",
"Spanish": "İspanyolca",
- "Speak": "Seslendir",
"Speech": "Konuşma",
"Speed": "Hız",
"Spin": "Dönme",
diff --git a/engine/crates/concat/locales/zh-Hans.json b/engine/crates/concat/locales/zh-Hans.json
index e48f0398..c69c3a52 100644
--- a/engine/crates/concat/locales/zh-Hans.json
+++ b/engine/crates/concat/locales/zh-Hans.json
@@ -131,7 +131,6 @@
"Delete {0} clips": "删除 {0} 个片段",
"Depth": "深度",
"Destination": "目标位置",
- "Detach audio": "分离音频",
"DETAILS": "详情",
"Distort": "扭曲",
"Distorted": "失真",
@@ -366,7 +365,6 @@
"Rate re-times the clip in place, so the timeline length changes with it. Trim afterwards, not before. A curve varies the rate over the clip; the same footage plays, faster here and slower there.": "速率就地改变片段的时间,时间线上的长度随之变化。修剪请在之后而非之前。曲线让速率在片段内变化:同一段素材,这里快一些,那里慢一些。",
"Razor (B)": "剃刀 (B)",
"Read this title aloud": "朗读此字幕",
- "Reattach": "重新合并",
"Recent": "最近",
"Recommended": "推荐",
"Redo": "重做",
@@ -438,7 +436,6 @@
"Sound": "声音",
"Space": "空间",
"Spanish": "西班牙语",
- "Speak": "朗读",
"Speech": "语音",
"Speed": "速度",
"Spin": "旋转",
diff --git a/engine/crates/concat/locales/zh-TW.json b/engine/crates/concat/locales/zh-TW.json
index 4ffb54d3..dacbdb17 100644
--- a/engine/crates/concat/locales/zh-TW.json
+++ b/engine/crates/concat/locales/zh-TW.json
@@ -165,7 +165,6 @@
"Delete {0} clips": "刪除 {0} 個片段",
"Depth": "深度",
"Destination": "目的地",
- "Detach audio": "分離音訊",
"Detail": "細節",
"DETAILS": "詳細資料",
"Digicam": "數位相機",
@@ -465,7 +464,6 @@
"Razor (B)": "剃刀(B)",
"Read a script aloud at the playhead": "在播放頭位置加入文稿朗讀語音",
"Read this title aloud": "朗讀此標題",
- "Reattach": "重新接回",
"Recent": "最近使用",
"Recommended": "建議",
"Red and blue pulled apart, the colour fringing of a cheap lens.": "將紅色與藍色錯開,模擬廉價鏡頭造成的彩色邊緣。",
@@ -555,7 +553,6 @@
"Source": "來源",
"Space": "空間感",
"Spanish": "西班牙文",
- "Speak": "朗讀",
"Speech": "文字轉語音",
"Speed": "速度",
"Spin": "旋轉",
diff --git a/engine/crates/concat/ui/dialogs/settings.slint b/engine/crates/concat/ui/dialogs/settings.slint
index 3cf70f35..e1f8bbaf 100644
--- a/engine/crates/concat/ui/dialogs/settings.slint
+++ b/engine/crates/concat/ui/dialogs/settings.slint
@@ -226,6 +226,7 @@ component ModelRow inherits Rectangle {
color: Theme.fg-muted;
font-family: Theme.font-technical;
font-size: Theme.fs-sm;
+ vertical-alignment: center;
}
Text {
@@ -233,6 +234,7 @@ component ModelRow inherits Rectangle {
color: Theme.fg-muted;
font-family: Theme.font-technical;
font-size: Theme.fs-sm;
+ vertical-alignment: center;
}
}
}
@@ -311,6 +313,9 @@ component FactRow inherits HorizontalLayout {
font-family: Theme.font-technical;
font-size: Theme.fs;
horizontal-alignment: right;
+ // The label beside this one is centred and the row is taller than a
+ // line; without this the value rides at the top of it.
+ vertical-alignment: center;
read-only: true;
single-line: false;
wrap: word-wrap;
diff --git a/engine/crates/concat/ui/primitives/modal.slint b/engine/crates/concat/ui/primitives/modal.slint
index 13558e47..fbe07210 100644
--- a/engine/crates/concat/ui/primitives/modal.slint
+++ b/engine/crates/concat/ui/primitives/modal.slint
@@ -344,8 +344,12 @@ export component DialogSection inherits VerticalLayout {
background: Theme.line;
}
+ // The header band. Tight to the title, because the gap under it is the
+ // header's leftover height plus the body's top padding, and the two
+ // together were reading as a break between groups rather than as a title
+ // sitting on the thing it names.
Rectangle {
- height: 36px;
+ height: 30px;
background: !root.collapsible ? Colors.transparent
: head.has-hover ? Theme.field
: Theme.raised;
@@ -423,13 +427,17 @@ export component DialogSection inherits VerticalLayout {
height: root.open ? body.preferred-height : 0px;
clip: true;
- // An equal 14px inset on every side, matching the sheet's own gutter.
+ // A 14px inset on three sides, matching the sheet's own gutter, and
+ // a short one on top: the title above is already a header's worth of
+ // space away, and a full gutter under it as well left every group
+ // looking detached from its own heading.
body := VerticalLayout {
x: 0;
y: 0;
width: parent.width;
height: self.preferred-height;
padding: 14px;
+ padding-top: 4px;
spacing: 6px;
@children
}
diff --git a/engine/crates/concat/ui/primitives/panel.slint b/engine/crates/concat/ui/primitives/panel.slint
index 03f71395..79647898 100644
--- a/engine/crates/concat/ui/primitives/panel.slint
+++ b/engine/crates/concat/ui/primitives/panel.slint
@@ -278,7 +278,16 @@ export component IconButton inherits Rectangle {
tint: root.tint;
}
+ // Given the chip's whole box, because an alignment is only ever
+ // relative to the box the text has. A Text takes its own implicit
+ // size inside a Rectangle - a Rectangle is not a layout, and nothing
+ // stretches it - so without these four it is a text-sized box at the
+ // top left corner, and centring it inside itself moves nothing.
if root.text != "": Text {
+ x: 0;
+ y: 0;
+ width: parent.width;
+ height: parent.height;
text: root.text;
color: root.tint;
font-size: Theme.fs;
diff --git a/engine/crates/concat/ui/primitives/segmented-control.slint b/engine/crates/concat/ui/primitives/segmented-control.slint
index 5e783449..79878540 100644
--- a/engine/crates/concat/ui/primitives/segmented-control.slint
+++ b/engine/crates/concat/ui/primitives/segmented-control.slint
@@ -78,7 +78,14 @@ export component SegmentedControl inherits Rectangle {
width: root.seg-w;
height: root.height - 2 * root.inset;
+ // The segment's whole box, so the label can centre in it; see the
+ // note on IconButton's text in panel.slint for why a Text needs to
+ // be handed one.
Text {
+ x: 0;
+ y: 0;
+ width: parent.width;
+ height: parent.height;
text: option;
color: (index == root.current || segment.has-hover) ? Theme.fg : Theme.fg-muted;
font-size: Theme.fs;
diff --git a/engine/crates/concat/ui/start.slint b/engine/crates/concat/ui/start.slint
index 268b4b4e..fca3eea6 100644
--- a/engine/crates/concat/ui/start.slint
+++ b/engine/crates/concat/ui/start.slint
@@ -155,6 +155,11 @@ component PlainInput inherits Rectangle {
x: 0;
y: (parent.height - self.height) / 2;
width: parent.width;
+ // A TextInput fills its Rectangle parent by default, so without this
+ // the centring above subtracts the parent's own height from itself
+ // and resolves to zero, leaving the text against the top edge. Same
+ // fix, and the same reason, as Field in modal.slint.
+ height: self.preferred-height;
text <=> root.draft;
color: Theme.fg;
font-family: root.face;
diff --git a/engine/crates/concat/ui/timeline/tabs.slint b/engine/crates/concat/ui/timeline/tabs.slint
index 900a78a8..1c31b2cf 100644
--- a/engine/crates/concat/ui/timeline/tabs.slint
+++ b/engine/crates/concat/ui/timeline/tabs.slint
@@ -139,6 +139,11 @@ component Tab inherits Rectangle {
x: 5px;
y: (parent.height - self.height) / 2;
width: parent.width - 10px;
+ // A TextInput fills its Rectangle parent by default, so without
+ // this the centring above subtracts the parent's own height from
+ // itself and resolves to zero, leaving the text against the top
+ // edge. Same fix, and the same reason, as Field in modal.slint.
+ height: self.preferred-height;
text: root.name;
color: Theme.fg;
font-size: Theme.fs;
diff --git a/engine/crates/concat/ui/timeline/tray.slint b/engine/crates/concat/ui/timeline/tray.slint
index d80e68b6..8f3f93e5 100644
--- a/engine/crates/concat/ui/timeline/tray.slint
+++ b/engine/crates/concat/ui/timeline/tray.slint
@@ -3,9 +3,8 @@
import { I18n } from "../i18n.slint";
import { Theme } from "../theme/theme.slint";
-import { Glyph, Icon } from "../icons.slint";
+import { Glyph } from "../icons.slint";
import { IconButton } from "../primitives/panel.slint";
-import { Tip } from "../primitives/tooltip.slint";
import { TimelineTool } from "model.slint";
// The timeline's tool tray.
@@ -17,85 +16,21 @@ import { TimelineTool } from "model.slint";
// tall, 4px between buttons, an 18px hairline with 4px of air on each side
// between groups. Tight, without crowding a 26px button.
//
-// The sound and word tools carry their names on the bar. They used to hang
-// off one menu button, and a menu is where a tool goes to not be found:
-// nobody looking for captions opens a waveform icon. Captions and Speak
-// open their sheets whatever is selected - each has a source of its own
-// to fall back on - and the tip says what the sheet will start on. Detach
-// is greyed rather than absent when the selection cannot use it, because
-// a greyed button with a tip answers "why not" and an absent one only
-// asks it.
+// The sound and word tools sit on the bar rather than behind a menu,
+// because a menu is where a tool goes to not be found. They are marks like
+// every other button here, and what names them is the tip: a sentence
+// saying what the press will do, which reads better on hover than a word
+// beside the mark reads at rest. Captions and Speak open whatever is
+// selected - each has a source of its own to fall back on - and the tip
+// says which. Detach is greyed rather than absent when the selection
+// cannot use it, because a greyed button with a tip answers "why not" and
+// an absent one only asks it.
//
// A disabled Merge carries the reason it is blocked, because a button that
// greys out without saying why leaves you guessing at the rule:
// `merge-blocked-because` is accepted and becomes the button's label, which
// is its accessible name and where a tooltip reads from.
-// A tool with its name beside its mark: the same chip an IconButton is,
-// wide enough for a word.
-component TrayTool inherits Rectangle {
- in property <Glyph> glyph;
- in property <string> caption;
- /// what the tip says; the reason, when the tool is greyed
- in property <string> label;
- in property <bool> enabled: true;
-
- callback clicked();
-
- property <bool> lit: touch.has-hover && root.enabled;
- property <brush> tint: root.lit ? Theme.fg : Theme.fg-muted;
-
- width: text.preferred-width + 35px;
- min-height: 26px;
-
- chip := Rectangle {
- y: (root.height - self.height) / 2;
- width: root.width;
- height: 26px;
- border-radius: Theme.r-sm;
- opacity: root.enabled ? 1.0 : 0.4;
- background: !root.enabled ? Colors.transparent
- : touch.pressed ? Theme.field-active
- : touch.has-hover ? Theme.field
- : Colors.transparent;
-
- animate background { duration: 100ms; easing: cubic-bezier(0.4, 0, 0.2, 1); }
-
- HorizontalLayout {
- padding-left: 8px;
- padding-right: 9px;
- spacing: 5px;
-
- VerticalLayout {
- alignment: center;
- Icon {
- glyph: root.glyph;
- size: 14px;
- tint: root.tint;
- }
- }
-
- text := Text {
- text: root.caption;
- color: root.tint;
- font-size: Theme.fs-sm;
- vertical-alignment: center;
- }
- }
-
- touch := TouchArea {
- enabled: root.enabled;
- mouse-cursor: pointer;
- clicked => { root.clicked(); }
- }
-
- Tip {
- text: root.label;
- active: touch.has-hover;
- }
- }
-}
-
component Divider inherits Rectangle {
width: 9px;
@@ -231,33 +166,33 @@ export component TimelineTray inherits Rectangle {
Divider { }
- TrayTool {
+ IconButton {
glyph: Glyph.text-mark;
- caption: I18n.t("Captions");
label: root.sound-selected ? I18n.t("Auto captions from this clip's sound")
: I18n.t("Captions from a script, at the playhead");
+ icon-size: 16px;
clicked => { root.captions(); }
}
- TrayTool {
+ IconButton {
glyph: Glyph.volume;
- caption: I18n.t("Speak");
label: root.title-selected ? I18n.t("Read this title aloud")
: I18n.t("Read a script aloud at the playhead");
+ icon-size: 16px;
clicked => { root.speak(); }
}
// One slot, two verbs: the sound is either on its picture or off it.
- if !root.can-reattach: TrayTool {
+ if !root.can-reattach: IconButton {
glyph: Glyph.waveform;
- caption: I18n.t("Detach audio");
label: root.can-detach ? I18n.t("Put this clip's sound on its own lane")
: I18n.t("Select one video clip to detach its sound");
+ icon-size: 16px;
enabled: root.can-detach;
clicked => { root.detach(); }
}
- if root.can-reattach: TrayTool {
+ if root.can-reattach: IconButton {
glyph: Glyph.merge;
- caption: I18n.t("Reattach");
label: I18n.t("Put the detached sound back on its picture");
+ icon-size: 16px;
clicked => { root.reattach(); }
}
diff --git a/engine/crates/concat/ui/workspace/config-pane.slint b/engine/crates/concat/ui/workspace/config-pane.slint
index 3e060d53..c225a63e 100644
--- a/engine/crates/concat/ui/workspace/config-pane.slint
+++ b/engine/crates/concat/ui/workspace/config-pane.slint
@@ -52,6 +52,9 @@ component FactRow inherits HorizontalLayout {
font-family: Theme.font-technical;
font-size: Theme.fs;
horizontal-alignment: right;
+ // The label beside this one is centred and the row is taller than a
+ // line; without this the value rides at the top of it.
+ vertical-alignment: center;
// Selectable, never editable: this is a readout of the project, and
// the Modify button is where changing it lives.
read-only: true;
diff --git a/engine/crates/concat/ui/workspace/timeline-pane.slint b/engine/crates/concat/ui/workspace/timeline-pane.slint
index 09a6e47e..09fef9a0 100644
--- a/engine/crates/concat/ui/workspace/timeline-pane.slint
+++ b/engine/crates/concat/ui/workspace/timeline-pane.slint
@@ -101,17 +101,19 @@ export component TimelinePane inherits Rectangle {
/// That row was used.
callback pane-removed();
- /// Wide enough for a lane name and its switches without eliding the name
- /// at every default. This column carries four switches, and at 164px the
- /// name was left with about six characters once the remove button
- /// appeared on hover. Both numbers went up by one 26px slot when the
- /// row-height menu joined the switches — the alternative was a name that
- /// elided at the default width, which is the thing this width exists to
- /// prevent.
- in-out property <length> header-width: 234px;
- /// Narrow enough to be useful as a squeeze, wide enough that the switches
- /// never overlap the name.
- in property <length> min-header: 158px;
+ /// Wide enough for what the column actually carries, and no wider: every
+ /// pixel here is a pixel the lanes do not get.
+ ///
+ /// A lane has no name — it is untyped, and its place in the stack is the
+ /// only handle anything needs on it — so the column is a strip of
+ /// switches. Five 26px slots at their widest (remove, row height, lock,
+ /// visibility, mute; remove only on hover), 1px between them and the
+ /// row's own 8px and 4px gutters come to 147px. The rest is the give
+ /// that keeps the switches off the scrollbar on the trailing edge.
+ in-out property <length> header-width: 156px;
+ /// The switches and their gutters, and nothing spare: below this the row
+ /// has nowhere left to take the squeeze from and the buttons overlap.
+ in property <length> min-header: 150px;
/// Where the column was when the divider went down. A drag is one pointer,
/// so one slot is enough.
diff --git a/scripts/locales.py b/scripts/locales.py
index cb4271c6..6e2f46c1 100755
--- a/scripts/locales.py
+++ b/scripts/locales.py
@@ -1,7 +1,8 @@
#!/usr/bin/env python3
"""The interface's string inventory, and the check that every locale keeps up.
- scripts/locales.py # rewrite locales/en.json from the source
+ scripts/locales.py # rewrite locales/en.json from the source,
+ # and drop lines no source asks for
scripts/locales.py --check # report what each locale lacks; exit 1 on
# a key no source asks for
@@ -80,6 +81,32 @@ def write_inventory(inventory: set[str]) -> None:
)
+def prune(inventory: set[str]) -> int:
+ """Drops lines for strings the interface no longer has.
+
+ A stale line fails --check, and the only thing to do about one is delete
+ it: the string it translates is gone from the source, so the translation
+ has nothing left to be of. Done here rather than by hand across twelve
+ files, and only on a plain run - --check reports, it never edits.
+ """
+ dropped = 0
+ for path in sorted(LOCALES.glob("*.json")):
+ if path.name == "en.json":
+ continue
+ data = read(path)
+ stale = [k for k in data if k != "_" and k not in inventory]
+ if not stale:
+ continue
+ for key in stale:
+ del data[key]
+ path.write_text(
+ json.dumps(data, ensure_ascii=False, indent=2) + "\n", encoding="utf-8"
+ )
+ print(f"{path.stem:8s} dropped {len(stale)}: {', '.join(repr(k) for k in stale)}")
+ dropped += len(stale)
+ return dropped
+
+
def check(inventory: set[str]) -> int:
failed = 0
for path in sorted(LOCALES.glob("*.json")):
@@ -115,6 +142,7 @@ def main() -> int:
return check(inventory)
write_inventory(inventory)
print(f"{len(inventory)} strings in {LOCALES / 'en.json'}")
+ prune(inventory)
return check(inventory) and 0