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

modals: fix sub-modals and power menu keyboard focus in connected mode

fixes #2346
This commit is contained in:
bbedward
2026-05-04 10:38:49 -04:00
parent 31e60a3df5
commit cc47703d48
2 changed files with 13 additions and 9 deletions

View File

@@ -259,20 +259,24 @@ DankModal {
cancelHold();
close();
}
onOpened: () => {
onShouldBeVisibleChanged: {
if (!shouldBeVisible)
return;
holdAction = "";
holdActionIndex = -1;
holdProgress = 0;
showHoldHint = false;
updateVisibleActions();
const defaultIndex = getDefaultActionIndex();
selectedIndex = defaultIndex;
if (SettingsData.powerMenuGridLayout) {
selectedRow = Math.floor(defaultIndex / gridColumns);
selectedCol = defaultIndex % gridColumns;
selectedIndex = defaultIndex;
} else {
selectedIndex = defaultIndex;
}
}
onShouldHaveFocusChanged: {
if (!shouldHaveFocus)
return;
Qt.callLater(() => modalFocusScope.forceActiveFocus());
}
onDialogClosed: () => {