diff --git a/crates/qbz-i18n/translations/de/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/de/LC_MESSAGES/qbz-ui.po index fbc3f5261..7e600a0c0 100644 --- a/crates/qbz-i18n/translations/de/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/de/LC_MESSAGES/qbz-ui.po @@ -4794,6 +4794,12 @@ msgstr "Optional — externe Laufwerke & NAS" msgid "Copy" msgstr "Kopieren" +msgid "Cut" +msgstr "Ausschneiden" + +msgid "Paste" +msgstr "Einfügen" + msgid "Copied!" msgstr "Kopiert!" diff --git a/crates/qbz-i18n/translations/es/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/es/LC_MESSAGES/qbz-ui.po index 632c14100..ba31c045d 100644 --- a/crates/qbz-i18n/translations/es/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/es/LC_MESSAGES/qbz-ui.po @@ -4830,6 +4830,12 @@ msgstr "Opcional — discos externos y NAS" msgid "Copy" msgstr "Copiar" +msgid "Cut" +msgstr "Cortar" + +msgid "Paste" +msgstr "Pegar" + msgid "Copied!" msgstr "¡Copiado!" diff --git a/crates/qbz-i18n/translations/fr/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/fr/LC_MESSAGES/qbz-ui.po index 6a1b082c7..9cea19a1e 100644 --- a/crates/qbz-i18n/translations/fr/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/fr/LC_MESSAGES/qbz-ui.po @@ -4794,6 +4794,12 @@ msgstr "Optionnel — disques externes et NAS" msgid "Copy" msgstr "Copier" +msgid "Cut" +msgstr "Couper" + +msgid "Paste" +msgstr "Coller" + msgid "Copied!" msgstr "Copié !" diff --git a/crates/qbz-i18n/translations/ja/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/ja/LC_MESSAGES/qbz-ui.po index 84d3b5262..d3075de03 100644 --- a/crates/qbz-i18n/translations/ja/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/ja/LC_MESSAGES/qbz-ui.po @@ -4783,6 +4783,12 @@ msgstr "任意 — 外部ドライブと NAS" msgid "Copy" msgstr "コピー" +msgid "Cut" +msgstr "切り取り" + +msgid "Paste" +msgstr "貼り付け" + msgid "Copied!" msgstr "コピーしました!" diff --git a/crates/qbz-i18n/translations/nl/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/nl/LC_MESSAGES/qbz-ui.po index 4c83dc9ec..719cd49de 100644 --- a/crates/qbz-i18n/translations/nl/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/nl/LC_MESSAGES/qbz-ui.po @@ -4806,6 +4806,12 @@ msgstr "Optioneel — externe schijven & NAS" msgid "Copy" msgstr "Kopiëren" +msgid "Cut" +msgstr "Knippen" + +msgid "Paste" +msgstr "Plakken" + msgid "Copied!" msgstr "Gekopieerd!" diff --git a/crates/qbz-i18n/translations/pt/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/pt/LC_MESSAGES/qbz-ui.po index 1d7ad5165..537dcef1f 100644 --- a/crates/qbz-i18n/translations/pt/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/pt/LC_MESSAGES/qbz-ui.po @@ -4794,6 +4794,12 @@ msgstr "Opcional — discos externos e NAS" msgid "Copy" msgstr "Copiar" +msgid "Cut" +msgstr "Recortar" + +msgid "Paste" +msgstr "Colar" + msgid "Copied!" msgstr "Copiado!" diff --git a/crates/qbz-i18n/translations/ru/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/ru/LC_MESSAGES/qbz-ui.po index 6b35c0c0b..46f19e73e 100644 --- a/crates/qbz-i18n/translations/ru/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/ru/LC_MESSAGES/qbz-ui.po @@ -4810,6 +4810,12 @@ msgstr "Опционально — внешние диски и NAS" msgid "Copy" msgstr "Копировать" +msgid "Cut" +msgstr "Вырезать" + +msgid "Paste" +msgstr "Вставить" + msgid "Copied!" msgstr "Скопировано!" diff --git a/crates/qbz-qt/qml/assets/icons/accent/clipboard.svg b/crates/qbz-qt/qml/assets/icons/accent/clipboard.svg new file mode 100644 index 000000000..e1155a901 --- /dev/null +++ b/crates/qbz-qt/qml/assets/icons/accent/clipboard.svg @@ -0,0 +1 @@ + diff --git a/crates/qbz-qt/qml/assets/icons/accent/scissors.svg b/crates/qbz-qt/qml/assets/icons/accent/scissors.svg new file mode 100644 index 000000000..e6b10d0a5 --- /dev/null +++ b/crates/qbz-qt/qml/assets/icons/accent/scissors.svg @@ -0,0 +1 @@ + diff --git a/crates/qbz-qt/qml/assets/icons/black/clipboard.svg b/crates/qbz-qt/qml/assets/icons/black/clipboard.svg new file mode 100644 index 000000000..50c987209 --- /dev/null +++ b/crates/qbz-qt/qml/assets/icons/black/clipboard.svg @@ -0,0 +1 @@ + diff --git a/crates/qbz-qt/qml/assets/icons/black/scissors.svg b/crates/qbz-qt/qml/assets/icons/black/scissors.svg new file mode 100644 index 000000000..8bc97a13a --- /dev/null +++ b/crates/qbz-qt/qml/assets/icons/black/scissors.svg @@ -0,0 +1 @@ + diff --git a/crates/qbz-qt/qml/assets/icons/muted/clipboard.svg b/crates/qbz-qt/qml/assets/icons/muted/clipboard.svg new file mode 100644 index 000000000..a523aebdc --- /dev/null +++ b/crates/qbz-qt/qml/assets/icons/muted/clipboard.svg @@ -0,0 +1 @@ + diff --git a/crates/qbz-qt/qml/assets/icons/muted/scissors.svg b/crates/qbz-qt/qml/assets/icons/muted/scissors.svg new file mode 100644 index 000000000..f08adaf53 --- /dev/null +++ b/crates/qbz-qt/qml/assets/icons/muted/scissors.svg @@ -0,0 +1 @@ + diff --git a/crates/qbz-qt/qml/assets/icons/primary/clipboard.svg b/crates/qbz-qt/qml/assets/icons/primary/clipboard.svg new file mode 100644 index 000000000..93185d37d --- /dev/null +++ b/crates/qbz-qt/qml/assets/icons/primary/clipboard.svg @@ -0,0 +1 @@ + diff --git a/crates/qbz-qt/qml/assets/icons/primary/scissors.svg b/crates/qbz-qt/qml/assets/icons/primary/scissors.svg new file mode 100644 index 000000000..d897b9d56 --- /dev/null +++ b/crates/qbz-qt/qml/assets/icons/primary/scissors.svg @@ -0,0 +1 @@ + diff --git a/crates/qbz-qt/qml/assets/icons/secondary/clipboard.svg b/crates/qbz-qt/qml/assets/icons/secondary/clipboard.svg new file mode 100644 index 000000000..2a7c39a8a --- /dev/null +++ b/crates/qbz-qt/qml/assets/icons/secondary/clipboard.svg @@ -0,0 +1 @@ + diff --git a/crates/qbz-qt/qml/assets/icons/secondary/scissors.svg b/crates/qbz-qt/qml/assets/icons/secondary/scissors.svg new file mode 100644 index 000000000..9c280df52 --- /dev/null +++ b/crates/qbz-qt/qml/assets/icons/secondary/scissors.svg @@ -0,0 +1 @@ + diff --git a/crates/qbz-qt/qml/assets/icons/warning/clipboard.svg b/crates/qbz-qt/qml/assets/icons/warning/clipboard.svg new file mode 100644 index 000000000..50c87b990 --- /dev/null +++ b/crates/qbz-qt/qml/assets/icons/warning/clipboard.svg @@ -0,0 +1 @@ + diff --git a/crates/qbz-qt/qml/assets/icons/warning/scissors.svg b/crates/qbz-qt/qml/assets/icons/warning/scissors.svg new file mode 100644 index 000000000..3ec64a7e7 --- /dev/null +++ b/crates/qbz-qt/qml/assets/icons/warning/scissors.svg @@ -0,0 +1 @@ + diff --git a/crates/qbz-qt/qml/shell/HeaderBar.qml b/crates/qbz-qt/qml/shell/HeaderBar.qml index cc08c41cd..3fbf04642 100644 --- a/crates/qbz-qt/qml/shell/HeaderBar.qml +++ b/crates/qbz-qt/qml/shell/HeaderBar.qml @@ -832,13 +832,50 @@ Rectangle { // the reference opens on the FIRST keystroke >= 2 chars and // debounces only the LOAD. Rust's version guard is what discards // the superseded loads. - onTextEdited: { + // Shared by keyboard edits (onTextEdited) and the edit menu's + // cut/paste, which are PROGRAMMATIC changes — TextInput only + // emits textEdited for user input, so a menu paste would + // otherwise change the text without ever driving the cortinilla. + function applyLiveQuery() { if (text.trim().length < 2) { QbzSearch.cortinillaDismiss() } else { QbzSearch.searchLive(text) } } + onTextEdited: applyLiveQuery() + + // QoL round: clipboard access by pointer, not only Ctrl+C/X/V — + // QML TextInput has no system edit menu of its own. RightButton + // only, so left clicks keep placing the cursor. + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.RightButton + onClicked: function (mouse) { + searchEditMenu.openAtCursor(searchInput, mouse.x, mouse.y) + } + } + CardMenu { + id: searchEditMenu + menuWidth: 160 + entries: { + var t = QbzSession.tr + var r = QbzSession.trRev + var hasSel = searchInput.selectedText !== "" + return [ + { "label": t("Cut", r), "icon": "scissors", "action": "cut", "enabled": hasSel }, + { "label": t("Copy", r), "icon": "copy", "action": "copy", "enabled": hasSel }, + { "label": t("Paste", r), "icon": "clipboard", "action": "paste", "enabled": searchInput.canPaste }, + { "label": t("Select all", r), "icon": "square-check-big", "action": "select-all", "enabled": searchInput.text !== "" }, + ] + } + onPicked: function (a) { + if (a === "cut") { searchInput.cut(); searchInput.applyLiveQuery() } + else if (a === "copy") searchInput.copy() + else if (a === "paste") { searchInput.paste(); searchInput.applyLiveQuery() } + else if (a === "select-all") searchInput.selectAll() + } + } // The Enter rule (HeaderBar.slint on-enter): cortinilla open + // a keyboard selection -> activate the row; open + none -> full diff --git a/crates/qbz-qt/src/icon_tint_qt.rs b/crates/qbz-qt/src/icon_tint_qt.rs index 3ecc068a8..db00c180b 100644 --- a/crates/qbz-qt/src/icon_tint_qt.rs +++ b/crates/qbz-qt/src/icon_tint_qt.rs @@ -174,6 +174,7 @@ const MASTERS: &[(&str, &str)] = &[ ("circle-alert", include_str!("../qml/assets/icons/primary/circle-alert.svg")), ("circle-check-big", include_str!("../qml/assets/icons/primary/circle-check-big.svg")), ("circle-stop", include_str!("../qml/assets/icons/primary/circle-stop.svg")), + ("clipboard", include_str!("../qml/assets/icons/primary/clipboard.svg")), ("clock", include_str!("../qml/assets/icons/primary/clock.svg")), ("cloud-download", include_str!("../qml/assets/icons/primary/cloud-download.svg")), ("cloud-off", include_str!("../qml/assets/icons/primary/cloud-off.svg")), @@ -266,6 +267,7 @@ const MASTERS: &[(&str, &str)] = &[ ("repeat", include_str!("../qml/assets/icons/primary/repeat.svg")), ("rotate-ccw", include_str!("../qml/assets/icons/primary/rotate-ccw.svg")), ("rows-3", include_str!("../qml/assets/icons/primary/rows-3.svg")), + ("scissors", include_str!("../qml/assets/icons/primary/scissors.svg")), ("search", include_str!("../qml/assets/icons/primary/search.svg")), // The GEAR. Distinct from settings-2 (two sliders) — the kiosk NavRail's // seventh tile uses this one (`shell/NavRail.slint:185`).