mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-29 14:46:02 +08:00
update FluWindowDialog
This commit is contained in:
parent
d655dc0141
commit
796be2a8f2
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user