From a184e6b7df1b5e431b0ddaf5fdda932793fda880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Fri, 15 Mar 2024 22:18:02 +0800 Subject: [PATCH] update --- .../imports/FluentUI/Controls/FluWindowDialog.qml | 12 ++++++++++-- .../imports/FluentUI/Controls/FluWindowDialog.qml | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/Qt5/imports/FluentUI/Controls/FluWindowDialog.qml b/src/Qt5/imports/FluentUI/Controls/FluWindowDialog.qml index 0e14060d..78f54bda 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluWindowDialog.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluWindowDialog.qml @@ -9,11 +9,19 @@ FluWindow { property Component contentDelegate autoVisible: false autoCenter: false - autoDestory: false + autoDestory: true fixSize: true Loader{ anchors.fill: parent - sourceComponent: control.visible ? control.contentDelegate : undefined + sourceComponent: { + if(control.autoDestory){ + return control.visible ? control.contentDelegate : undefined + } + return control.contentDelegate + } + } + closeListener: function(event){ + event.accepted = true } function showDialog(){ var x = transientParent.x + (transientParent.width - width)/2 diff --git a/src/Qt6/imports/FluentUI/Controls/FluWindowDialog.qml b/src/Qt6/imports/FluentUI/Controls/FluWindowDialog.qml index ff524536..a5f03a7c 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluWindowDialog.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluWindowDialog.qml @@ -9,11 +9,19 @@ FluWindow { property Component contentDelegate autoVisible: false autoCenter: false - autoDestory: false + autoDestory: true fixSize: true Loader{ anchors.fill: parent - sourceComponent: control.visible ? control.contentDelegate : undefined + sourceComponent: { + if(control.autoDestory){ + return control.visible ? control.contentDelegate : undefined + } + return control.contentDelegate + } + } + closeListener: function(event){ + event.accepted = true } function showDialog(){ var x = transientParent.x + (transientParent.width - width)/2