1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

Aggresive focus restoration

This commit is contained in:
bbedward
2025-10-06 17:52:48 -04:00
parent 7c5d1ec0f6
commit 3871f3cf3d

View File

@@ -90,6 +90,11 @@ DankModal {
parentModal.shouldHaveFocus = Qt.binding(() => {
return parentModal.shouldBeVisible
})
Qt.callLater(() => {
if (parentModal && parentModal.modalFocusScope) {
parentModal.modalFocusScope.forceActiveFocus()
}
})
}
}
@@ -105,6 +110,16 @@ DankModal {
filteredWidgets = []
selectedIndex = -1
keyboardNavigationActive = false
if (parentModal) {
parentModal.shouldHaveFocus = Qt.binding(() => {
return parentModal.shouldBeVisible
})
Qt.callLater(() => {
if (parentModal && parentModal.modalFocusScope) {
parentModal.modalFocusScope.forceActiveFocus()
}
})
}
}
onBackgroundClicked: () => {
return hide()