mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Merge pull request #1924 from tmarti2/fix-session-menu-grid-initial-press
Fix Grid SessionMenu right/down press when nothing is selected
This commit is contained in:
@@ -157,11 +157,16 @@ SmartPanel {
|
||||
|
||||
// Lifecycle handlers
|
||||
onOpened: {
|
||||
selectedIndex = -1;
|
||||
ignoreMouseHover = true;
|
||||
globalMouseInitialized = false;
|
||||
mouseTrackingReady = false;
|
||||
mouseTrackingDelayTimer.restart();
|
||||
if (powerOptions.length > 0) {
|
||||
selectedIndex = -1;
|
||||
ignoreMouseHover = true;
|
||||
globalMouseInitialized = false;
|
||||
mouseTrackingReady = false;
|
||||
mouseTrackingDelayTimer.restart();
|
||||
} else {
|
||||
Logger.w("SessionMenu", "Trying to open an empty session menu");
|
||||
root.closeImmediately();
|
||||
}
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
@@ -322,13 +327,15 @@ SmartPanel {
|
||||
newCol = newCol - 1 < 0 ? grid.itemsInRow(newRow) - 1 : newCol - 1;
|
||||
break;
|
||||
case "right":
|
||||
newCol = newCol + 1 >= grid.itemsInRow(newRow) ? 0 : newCol + 1;
|
||||
// We already moved to newCol to 0 if grid.currentCol was negative
|
||||
newCol = grid.currentCol < 0 ? newRow : newCol + 1 >= grid.itemsInRow(newRow) ? 0 : newCol + 1;
|
||||
break;
|
||||
case "up":
|
||||
newRow = newRow - 1 < 0 ? grid.rows - 1 : newRow - 1;
|
||||
break;
|
||||
case "down":
|
||||
newRow = newRow + 1 >= grid.rows ? 0 : newRow + 1;
|
||||
// We already moved to newRow to 0 if grid.currentRow was negative
|
||||
newRow = grid.currentRow < 0 ? newRow : newRow + 1 >= grid.rows ? 0 : newRow + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user