1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-28 23: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(() => { parentModal.shouldHaveFocus = Qt.binding(() => {
return parentModal.shouldBeVisible return parentModal.shouldBeVisible
}) })
Qt.callLater(() => {
if (parentModal && parentModal.modalFocusScope) {
parentModal.modalFocusScope.forceActiveFocus()
}
})
} }
} }
@@ -105,6 +110,16 @@ DankModal {
filteredWidgets = [] filteredWidgets = []
selectedIndex = -1 selectedIndex = -1
keyboardNavigationActive = false keyboardNavigationActive = false
if (parentModal) {
parentModal.shouldHaveFocus = Qt.binding(() => {
return parentModal.shouldBeVisible
})
Qt.callLater(() => {
if (parentModal && parentModal.modalFocusScope) {
parentModal.modalFocusScope.forceActiveFocus()
}
})
}
} }
onBackgroundClicked: () => { onBackgroundClicked: () => {
return hide() return hide()