1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

Tie modal loader to shouldBeVisible

This commit is contained in:
bbedward
2025-09-30 11:01:51 -04:00
parent 02c4ac1bc7
commit 91aba84c29

View File

@@ -172,7 +172,7 @@ PanelWindow {
id: contentLoader
anchors.fill: parent
active: root.visible
active: root.shouldBeVisible
asynchronous: false
}
@@ -207,8 +207,8 @@ PanelWindow {
objectName: "modalFocusScope"
anchors.fill: parent
visible: root.visible // Only active when the modal is visible
focus: root.visible
visible: root.shouldBeVisible
focus: root.shouldBeVisible
Keys.onEscapePressed: event => {
if (root.closeOnEscapeKey && shouldHaveFocus) {
root.close()
@@ -223,7 +223,7 @@ PanelWindow {
Connections {
function onShouldHaveFocusChanged() {
if (shouldHaveFocus && visible) {
if (shouldHaveFocus && shouldBeVisible) {
Qt.callLater(() => focusScope.forceActiveFocus())
}
}