From 68b34831627272186c957a52a25430791fc9ee22 Mon Sep 17 00:00:00 2001 From: Damian D'Souza Date: Fri, 17 Oct 2025 00:46:34 +0200 Subject: [PATCH] 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()