1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-09 15:22:13 -04:00

Implement ability to cycle through launcher modes (#2003)

Use Ctrl+Left/Right and Ctrl+H/L to move back and forward through the
modes of the launcher
This commit is contained in:
Michael Erdely
2026-03-16 15:08:07 +00:00
committed by GitHub
parent 190fd662ad
commit 7f392acc54
2 changed files with 29 additions and 2 deletions

View File

@@ -353,10 +353,13 @@ Item {
performSearch();
}
function cycleMode() {
function cycleMode(reverse = false) {
var modes = ["all", "apps", "files", "plugins"];
var currentIndex = modes.indexOf(searchMode);
var nextIndex = (currentIndex + 1) % modes.length;
if (!reverse)
var nextIndex = (currentIndex + 1) % modes.length;
else
var nextIndex = (currentIndex - 1 + modes.length) % modes.length;
setMode(modes[nextIndex]);
}