From ad9452e6563bac410de7b3e8e7395f8064edc8c2 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 27 Apr 2025 20:35:28 +0200 Subject: [PATCH] left sidebar: add keybinds --- .../quickshell/modules/sidebarLeft/SidebarLeft.qml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/modules/sidebarLeft/SidebarLeft.qml b/.config/quickshell/modules/sidebarLeft/SidebarLeft.qml index 0a2e1f8e6..e9d43e844 100644 --- a/.config/quickshell/modules/sidebarLeft/SidebarLeft.qml +++ b/.config/quickshell/modules/sidebarLeft/SidebarLeft.qml @@ -16,7 +16,7 @@ Scope { // Scope id: root property int sidebarWidth: Appearance.sizes.sidebarWidth property int sidebarPadding: 15 - property var tabButtonList: [{"icon": "neurology", "name": qsTr("LLMs")}, {"icon": "flare", "name": qsTr("Waifus")}] + property var tabButtonList: [{"icon": "neurology", "name": qsTr("Intelligence")}, {"icon": "flare", "name": qsTr("Waifus")}] Variants { // Window repeater id: sidebarVariants @@ -81,11 +81,21 @@ Scope { // Scope height: parent.height - Appearance.sizes.hyprlandGapsOut * 2 color: Appearance.colors.colLayer0 radius: Appearance.rounding.screenRounding - Appearance.sizes.elevationMargin + 1 + focus: sidebarRoot.visible Keys.onPressed: (event) => { if (event.key === Qt.Key_Escape) { sidebarRoot.visible = false; } + if (event.modifiers === Qt.ControlModifier) { + console.log("Control pressed") + if (event.key === Qt.Key_PageDown) { + sidebarRoot.currentTab = Math.min(sidebarRoot.currentTab + 1, root.tabButtonList.length - 1) + } else if (event.key === Qt.Key_PageUp) { + sidebarRoot.currentTab = Math.max(sidebarRoot.currentTab - 1, 0) + } + event.accepted = true; + } } ColumnLayout {