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

View File

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