From 39a96c51449ba6a601cde01b49cd6c9cbfcd1964 Mon Sep 17 00:00:00 2001 From: Chandra Kant Date: Sun, 1 Nov 2026 23:37:14 +0530 Subject: [PATCH 1/2] Add keyboard shortcuts for front actions --- ryoku/shell/quickshell/ryoshot/shell.qml | 30 +++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/ryoku/shell/quickshell/ryoshot/shell.qml b/ryoku/shell/quickshell/ryoshot/shell.qml index 41dfd0476..2ec7145c7 100644 --- a/ryoku/shell/quickshell/ryoshot/shell.qml +++ b/ryoku/shell/quickshell/ryoshot/shell.qml @@ -122,11 +122,11 @@ ShellRoot { // capture and colour pick know which output the cursor sits on. property var lastPointer: null readonly property var frontActions: [ - { id: "shot", icon: "camera", label: I18n.tr("Shot") }, - { id: "edit", icon: "pen", label: I18n.tr("Edit") }, - { id: "ocr", icon: "ocr", label: I18n.tr("OCR") }, - { id: "search", icon: "magnify", label: I18n.tr("Search") }, - { id: "record", icon: "video", label: I18n.tr("Record") } + { id: "shot", icon: "camera", label: I18n.tr("Shot"), key: "s" }, + { id: "edit", icon: "pen", label: I18n.tr("Edit"), key: "e" }, + { id: "ocr", icon: "ocr", label: I18n.tr("OCR"), key: "o" }, + { id: "search", icon: "magnify", label: I18n.tr("Search"), key: "f" }, + { id: "record", icon: "video", label: I18n.tr("Record"), key: "r" } ] // RYOSHOT_OPEN=: skip selection and open that image straight in the // beautify editor. fromFile makes Escape / close quit, since there is no live @@ -1467,15 +1467,29 @@ ShellRoot { } return false; } + var ctrl = (e.modifiers & Qt.ControlModifier) !== 0; + var alt = (e.modifiers & Qt.AltModifier) !== 0; + var shift = (e.modifiers & Qt.ShiftModifier) !== 0; + if (e.key === Qt.Key_Space) { root.cycleTarget(); return true; } - if (e.key === Qt.Key_A && (e.modifiers & Qt.ControlModifier)) { root.wholeMonitor(); return true; } - if (e.key === Qt.Key_Question) { root.shortcutsOpen = !root.shortcutsOpen; return true; } - // Number keys pick the action; the count matches frontActions. + if (ctrl && e.key === Qt.Key_A) { root.wholeMonitor(); return true; } + if (e.key === Qt.Key_Question || (shift && e.key === Qt.Key_Slash)) { + root.shortcutsOpen = !root.shortcutsOpen; + return true; + } + if (ctrl || alt) return false; + + // Number keys or action mnemonics pick the action. if (e.key >= Qt.Key_1 && e.key <= Qt.Key_5) { var d = root.frontActions[e.key - Qt.Key_1]; if (d) { root.setFrontAction(d.id); return true; } return false; } + if (e.key === Qt.Key_S) { root.setFrontAction("shot"); return true; } + if (e.key === Qt.Key_E) { root.setFrontAction("edit"); return true; } + if (e.key === Qt.Key_O) { root.setFrontAction("ocr"); return true; } + if (e.key === Qt.Key_F) { root.setFrontAction("search"); return true; } + if (e.key === Qt.Key_R) { root.setFrontAction("record"); return true; } if (e.key === Qt.Key_C) { root.startColorPick(); return true; } if (e.key === Qt.Key_Return || e.key === Qt.Key_Enter) { var m = root.lastPointer ? root.monitorAt(root.lastPointer.x, root.lastPointer.y) : null; From 8c0267f52dbde14ebf18b63a894bf3a8194dec0d Mon Sep 17 00:00:00 2001 From: Chandra Kant Date: Sun, 1 Nov 2026 23:42:19 +0530 Subject: [PATCH 2/2] Implement hints visibility and timer in RegionBar Added hints visibility and timer functionality to RegionBar. --- ryoku/shell/quickshell/ryoshot/RegionBar.qml | 80 +++++++++++++++++--- 1 file changed, 71 insertions(+), 9 deletions(-) diff --git a/ryoku/shell/quickshell/ryoshot/RegionBar.qml b/ryoku/shell/quickshell/ryoshot/RegionBar.qml index ce687cfc4..ec30158da 100644 --- a/ryoku/shell/quickshell/ryoshot/RegionBar.qml +++ b/ryoku/shell/quickshell/ryoshot/RegionBar.qml @@ -20,6 +20,30 @@ Item { property bool keypressesOn: false property bool webcamOn: false property int delaySeconds: 0 + property bool hintsVisible: true + + Timer { + id: hintTimer + interval: 1400 + onTriggered: bar.hintsVisible = false + } + + onVisibleChanged: { + if (visible) { + hintsVisible = true; + hintTimer.restart(); + } else { + hintTimer.stop(); + hintsVisible = false; + } + } + + Component.onCompleted: { + if (visible) { + hintsVisible = true; + hintTimer.restart(); + } + } signal actionPicked(string id) signal colorPickRequested() @@ -67,6 +91,7 @@ Item { id: tab required property var modelData readonly property bool current: bar.activeAction === modelData.id + readonly property bool showKey: bar.hintsVisible && !!(tab.modelData && tab.modelData.key) width: tabContent.implicitWidth + 22 height: 34 radius: height / 2 @@ -77,6 +102,7 @@ Item { id: tabContent anchors.centerIn: parent spacing: 6 + Icon { anchors.verticalCenter: parent.verticalCenter name: tab.modelData.icon @@ -84,14 +110,50 @@ Item { tint: tab.current ? Theme.accentInk : (tabMa.containsMouse ? Theme.ink : Theme.inkDim) } - Text { + Row { anchors.verticalCenter: parent.verticalCenter - text: tab.modelData.label - font.family: Theme.ui - font.pixelSize: 13 - font.weight: tab.current ? Font.DemiBold : Font.Normal - color: tab.current ? Theme.accentInk - : (tabMa.containsMouse ? Theme.ink : Theme.inkDim) + spacing: tab.showKey ? 5 : 0 + Behavior on spacing { + NumberAnimation { duration: 250; easing.type: Easing.OutCubic } + } + + Text { + anchors.verticalCenter: parent.verticalCenter + text: tab.modelData.label + font.family: Theme.ui + font.pixelSize: 13 + font.weight: tab.current ? Font.DemiBold : Font.Normal + color: tab.current ? Theme.accentInk + : (tabMa.containsMouse ? Theme.ink : Theme.inkDim) + } + Item { + id: keySlot + anchors.verticalCenter: parent.verticalCenter + width: tab.showKey ? keyText.implicitWidth : 0 + height: keyText.implicitHeight + clip: true + visible: tab.showKey || width > 0 + + Behavior on width { + NumberAnimation { duration: 250; easing.type: Easing.OutCubic } + } + + Text { + id: keyText + anchors.centerIn: parent + text: (tab.modelData && tab.modelData.key ? tab.modelData.key : "").toUpperCase() + font.family: Theme.mono + font.pixelSize: 10 + font.weight: Font.Medium + color: tab.current ? Theme.accentInk + : (tabMa.containsMouse ? Theme.inkDim : Theme.inkFaint) + opacity: tab.showKey ? (tab.current ? 0.8 : 0.55) : 0 + + Behavior on opacity { + NumberAnimation { duration: 200; easing.type: Easing.OutCubic } + } + } + } } } @@ -189,13 +251,13 @@ Item { IconButton { Layout.alignment: Qt.AlignVCenter icon: "eyedropper" - tooltip: I18n.tr("Pick a colour") + tooltip: I18n.tr("Pick a colour") + " (C)" onClicked: bar.colorPickRequested() } IconButton { Layout.alignment: Qt.AlignVCenter icon: "fullscreen" - tooltip: I18n.tr("Capture this monitor") + tooltip: I18n.tr("Capture this monitor") + " (Enter)" onClicked: bar.fullscreenRequested() } IconButton {