mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
SessionMenu: implement wrapping select next/previous functions
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user