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()