1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -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 id: contentLoader
anchors.fill: parent anchors.fill: parent
active: root.visible active: root.shouldBeVisible
asynchronous: false asynchronous: false
} }
@@ -207,8 +207,8 @@ PanelWindow {
objectName: "modalFocusScope" objectName: "modalFocusScope"
anchors.fill: parent anchors.fill: parent
visible: root.visible // Only active when the modal is visible visible: root.shouldBeVisible
focus: root.visible focus: root.shouldBeVisible
Keys.onEscapePressed: event => { Keys.onEscapePressed: event => {
if (root.closeOnEscapeKey && shouldHaveFocus) { if (root.closeOnEscapeKey && shouldHaveFocus) {
root.close() root.close()
@@ -223,7 +223,7 @@ PanelWindow {
Connections { Connections {
function onShouldHaveFocusChanged() { function onShouldHaveFocusChanged() {
if (shouldHaveFocus && visible) { if (shouldHaveFocus && shouldBeVisible) {
Qt.callLater(() => focusScope.forceActiveFocus()) Qt.callLater(() => focusScope.forceActiveFocus())
} }
} }