From e85801208f34346000af9f912a4c72ddd10ac986 Mon Sep 17 00:00:00 2001 From: Damian D'Souza Date: Thu, 16 Oct 2025 20:23:41 +0200 Subject: [PATCH 1/6] Launcher: implement wrapping versions of select next/previous --- Modules/Launcher/Launcher.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Modules/Launcher/Launcher.qml b/Modules/Launcher/Launcher.qml index 271d4c4b..5d3a29b9 100644 --- a/Modules/Launcher/Launcher.qml +++ b/Modules/Launcher/Launcher.qml @@ -221,6 +221,18 @@ NPanel { } } + function selectNextWrapped() { + if (results.length > 0) { + selectedIndex = (selectedIndex + 1) % results.length + } + } + + function selectPreviousWrapped() { + if (results.length > 0) { + selectedIndex = (((selectedIndex - 1) % results.length) + results.length) % results.length + } + } + function selectFirst() { selectedIndex = 0 } From 0da0d460036b7e343e544dd8a94535edab30693b Mon Sep 17 00:00:00 2001 From: Damian D'Souza Date: Thu, 16 Oct 2025 20:24:40 +0200 Subject: [PATCH 2/6] Launcher: implement tab bsed navigation with wrapping next/previous functions --- Modules/Launcher/Launcher.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Modules/Launcher/Launcher.qml b/Modules/Launcher/Launcher.qml index 5d3a29b9..5deb4e85 100644 --- a/Modules/Launcher/Launcher.qml +++ b/Modules/Launcher/Launcher.qml @@ -279,6 +279,18 @@ NPanel { enabled: root.opened && searchInput.inputItem && searchInput.inputItem.activeFocus } + Shortcut { + sequence: "Tab" + onActivated: ui.selectNextWrapped() + enabled: root.opened && searchInput.inputItem && searchInput.inputItem.activeFocus + } + + Shortcut { + sequence: "Shift+Tab" + onActivated: ui.selectPreviousWrapped() + enabled: root.opened && searchInput.inputItem && searchInput.inputItem.activeFocus + } + Shortcut { sequence: "PgDown" // or "PageDown" onActivated: ui.selectNextPage() From 7715dbf17a6682d9ffe4f3c9592d5f3f426fd572 Mon Sep 17 00:00:00 2001 From: Damian D'Souza Date: Thu, 16 Oct 2025 20:25:14 +0200 Subject: [PATCH 3/6] SessionMenu: implement wrapping select next/previous functions --- Modules/SessionMenu/SessionMenu.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Modules/SessionMenu/SessionMenu.qml b/Modules/SessionMenu/SessionMenu.qml index 7bdbf22c..abf0181b 100644 --- a/Modules/SessionMenu/SessionMenu.qml +++ b/Modules/SessionMenu/SessionMenu.qml @@ -131,6 +131,18 @@ NPanel { } } + function selectNextWrapped() { + if (powerOptions.length > 0) { + selectedIndex = (selectedIndex + 1) % powerOptions.length + } + } + + function selectPreviousWrapped() { + if (powerOptions.length > 0) { + selectedIndex = (((selectedIndex - 1) % powerOptions.length) + powerOptions.length) % powerOptions.length + } + } + function selectFirst() { selectedIndex = 0 } From ab59e94ee607654754b1276cbd0d05e6f6c2d1af Mon Sep 17 00:00:00 2001 From: Damian D'Souza Date: Thu, 16 Oct 2025 20:25:50 +0200 Subject: [PATCH 4/6] SessionMenu: implement tab based navigation with wrapping next/previous functions --- Modules/SessionMenu/SessionMenu.qml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Modules/SessionMenu/SessionMenu.qml b/Modules/SessionMenu/SessionMenu.qml index abf0181b..b2a9b7fa 100644 --- a/Modules/SessionMenu/SessionMenu.qml +++ b/Modules/SessionMenu/SessionMenu.qml @@ -204,6 +204,18 @@ NPanel { enabled: root.opened } + Shortcut { + sequence: "Tab" + onActivated: ui.selectNextWrapped() + enabled: root.opened + } + + Shortcut { + sequence: "Shift+Tab" + onActivated: ui.selectPreviousWrapped() + enabled: root.opened + } + Shortcut { sequence: "Home" onActivated: ui.selectFirst() @@ -259,6 +271,14 @@ NPanel { root.selectLast() } + function selectNextWrapped() { + root.selectNextWrapped() + } + + function selectPreviousWrapped() { + root.selectPreviousWrapped() + } + function activate() { root.activate() } From 68b34831627272186c957a52a25430791fc9ee22 Mon Sep 17 00:00:00 2001 From: Damian D'Souza Date: Fri, 17 Oct 2025 00:46:34 +0200 Subject: [PATCH 5/6] Launcher: replace select next/previous usage with wrapping version --- Modules/Launcher/Launcher.qml | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/Modules/Launcher/Launcher.qml b/Modules/Launcher/Launcher.qml index 5deb4e85..a89844ad 100644 --- a/Modules/Launcher/Launcher.qml +++ b/Modules/Launcher/Launcher.qml @@ -207,20 +207,6 @@ NPanel { // --------------------- // Navigation - function selectNext() { - if (results.length > 0) { - // Clamp the index to not exceed the last item - selectedIndex = Math.min(selectedIndex + 1, results.length - 1) - } - } - - function selectPrevious() { - if (results.length > 0) { - // Clamp the index to not go below the first item (0) - selectedIndex = Math.max(selectedIndex - 1, 0) - } - } - function selectNextWrapped() { if (results.length > 0) { selectedIndex = (selectedIndex + 1) % results.length @@ -269,13 +255,13 @@ NPanel { Shortcut { sequence: "Ctrl+K" - onActivated: ui.selectPrevious() + onActivated: ui.selectPreviousWrapped() enabled: root.opened && searchInput.inputItem && searchInput.inputItem.activeFocus } Shortcut { sequence: "Ctrl+J" - onActivated: ui.selectNext() + onActivated: ui.selectNextWrapped() enabled: root.opened && searchInput.inputItem && searchInput.inputItem.activeFocus } @@ -351,10 +337,10 @@ NPanel { } }) searchInput.inputItem.Keys.onDownPressed.connect(function (event) { - ui.selectNext() + ui.selectNextWrapped() }) searchInput.inputItem.Keys.onUpPressed.connect(function (event) { - ui.selectPrevious() + ui.selectPreviousWrapped() }) searchInput.inputItem.Keys.onReturnPressed.connect(function (event) { ui.activate() From 4be26bc6043339cec4ea870f1c38e1f3f36d3bda Mon Sep 17 00:00:00 2001 From: Damian D'Souza Date: Fri, 17 Oct 2025 00:49:10 +0200 Subject: [PATCH 6/6] SessionMenu: replace select next/previous usage with wrapping version --- Modules/SessionMenu/SessionMenu.qml | 38 +++++++---------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/Modules/SessionMenu/SessionMenu.qml b/Modules/SessionMenu/SessionMenu.qml index b2a9b7fa..83afaf5f 100644 --- a/Modules/SessionMenu/SessionMenu.qml +++ b/Modules/SessionMenu/SessionMenu.qml @@ -119,18 +119,6 @@ NPanel { } // Navigation functions - function selectNext() { - if (powerOptions.length > 0) { - selectedIndex = Math.min(selectedIndex + 1, powerOptions.length - 1) - } - } - - function selectPrevious() { - if (powerOptions.length > 0) { - selectedIndex = Math.max(selectedIndex - 1, 0) - } - } - function selectNextWrapped() { if (powerOptions.length > 0) { selectedIndex = (selectedIndex + 1) % powerOptions.length @@ -182,30 +170,24 @@ NPanel { // Keyboard shortcuts Shortcut { sequence: "Ctrl+K" - onActivated: ui.selectPrevious() + onActivated: ui.selectPreviousWrapped() enabled: root.opened } Shortcut { sequence: "Ctrl+J" - onActivated: ui.selectNext() + onActivated: ui.selectNextWrapped() enabled: root.opened } Shortcut { sequence: "Up" - onActivated: ui.selectPrevious() + onActivated: ui.selectPreviousWrapped() enabled: root.opened } Shortcut { sequence: "Down" - onActivated: ui.selectNext() - enabled: root.opened - } - - Shortcut { - sequence: "Tab" onActivated: ui.selectNextWrapped() enabled: root.opened } @@ -216,6 +198,12 @@ NPanel { enabled: root.opened } + Shortcut { + sequence: "Tab" + onActivated: ui.selectNextWrapped() + enabled: root.opened + } + Shortcut { sequence: "Home" onActivated: ui.selectFirst() @@ -255,14 +243,6 @@ NPanel { } // Navigation functions - function selectNext() { - root.selectNext() - } - - function selectPrevious() { - root.selectPrevious() - } - function selectFirst() { root.selectFirst() }