update FluWindowDialog

This commit is contained in:
朱子楚\zhuzi 2024-03-21 11:29:49 +08:00
parent d655dc0141
commit 796be2a8f2
2 changed files with 21 additions and 4 deletions

View File

@ -10,6 +10,7 @@ FluWindow {
autoVisible: false autoVisible: false
autoCenter: false autoCenter: false
autoDestory: true autoDestory: true
stayTop: true
fixSize: true fixSize: true
Loader{ Loader{
anchors.fill: parent anchors.fill: parent
@ -24,11 +25,19 @@ FluWindow {
visible = false visible = false
event.accepted = false event.accepted = false
} }
Connections{
target: control.transientParent
function onVisibilityChanged(){
if(control.transientParent.visibility === Window.Hidden){
control.visibility = Window.Hidden
}
}
}
function showDialog(){ function showDialog(){
var x = transientParent.x + (transientParent.width - width)/2 var x = transientParent.x + (transientParent.width - width)/2
var y = transientParent.y + (transientParent.height - height)/2 var y = transientParent.y + (transientParent.height - height)/2
control.stayTop = Qt.binding(function(){return transientParent.stayTop}) control.stayTop = Qt.binding(function(){return transientParent.stayTop})
setGeometry(x,y,width,height) control.setGeometry(x,y,width,height)
visible = true control.visible = true
} }
} }

View File

@ -25,11 +25,19 @@ FluWindow {
visible = false visible = false
event.accepted = false event.accepted = false
} }
Connections{
target: control.transientParent
function onVisibleChanged(){
if(control.transientParent.visible === false){
control.visible = false
}
}
}
function showDialog(){ function showDialog(){
var x = transientParent.x + (transientParent.width - width)/2 var x = transientParent.x + (transientParent.width - width)/2
var y = transientParent.y + (transientParent.height - height)/2 var y = transientParent.y + (transientParent.height - height)/2
control.stayTop = Qt.binding(function(){return transientParent.stayTop}) control.stayTop = Qt.binding(function(){return transientParent.stayTop})
setGeometry(x,y,width,height) control.setGeometry(x,y,width,height)
visible = true control.visible = true
} }
} }