This commit is contained in:
zhuzichu
2023-12-29 11:04:54 +08:00
parent 8253fb611f
commit bf5c722058
4 changed files with 43 additions and 22 deletions

View File

@ -53,6 +53,7 @@ Window {
signal showSystemMenu
signal initArgument(var argument)
signal firstVisible()
property point _offsetXY : Qt.point(0,0)
id:window
color:"transparent"
Component.onCompleted: {
@ -72,6 +73,19 @@ Window {
Component.onDestruction: {
lifecycle.onDestruction()
}
onVisibilityChanged: {
if(visibility === Window.Maximized || visibility === Window.FullScreen){
var dx = window.x-Screen.virtualX
var dy = window.y-Screen.virtualY
if(dx<0 && dy<0){
_offsetXY = Qt.point(Math.abs(dx+1),Math.abs(dy+1))
}else{
_offsetXY = Qt.point(0,0)
}
}else{
_offsetXY = Qt.point(0,0)
}
}
onShowSystemMenu: {
if(loader_frameless_helper.item){
loader_frameless_helper.item.showSystemMenu()
@ -177,6 +191,10 @@ Window {
id:layout_container
anchors{
fill:parent
leftMargin: _offsetXY.x
rightMargin: _offsetXY.x
topMargin: _offsetXY.y
bottomMargin: _offsetXY.y
}
onWidthChanged: {
window.appBar.width = width
@ -229,7 +247,7 @@ Window {
border.width: window.resizeBorderWidth
border.color: window.resizeBorderColor
visible: {
if(window.useSystemAppBar || FluTools.isWin()){
if(window.useSystemAppBar){
return false
}
if(window.visibility == Window.Maximized || window.visibility == Window.FullScreen){