This commit is contained in:
朱子楚\zhuzi 2024-03-15 22:18:02 +08:00
parent 7c4bedb907
commit a184e6b7df
2 changed files with 20 additions and 4 deletions

View File

@ -9,11 +9,19 @@ FluWindow {
property Component contentDelegate property Component contentDelegate
autoVisible: false autoVisible: false
autoCenter: false autoCenter: false
autoDestory: false autoDestory: true
fixSize: true fixSize: true
Loader{ Loader{
anchors.fill: parent 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(){ function showDialog(){
var x = transientParent.x + (transientParent.width - width)/2 var x = transientParent.x + (transientParent.width - width)/2

View File

@ -9,11 +9,19 @@ FluWindow {
property Component contentDelegate property Component contentDelegate
autoVisible: false autoVisible: false
autoCenter: false autoCenter: false
autoDestory: false autoDestory: true
fixSize: true fixSize: true
Loader{ Loader{
anchors.fill: parent 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(){ function showDialog(){
var x = transientParent.x + (transientParent.width - width)/2 var x = transientParent.x + (transientParent.width - width)/2