This commit is contained in:
朱子楚\zhuzi
2023-12-15 22:41:11 +08:00
parent d347512486
commit c5aad9feed
6 changed files with 162 additions and 133 deletions

View File

@ -16,7 +16,6 @@ Window {
property bool fitsAppBarWindows: false
property Item appBar: FluAppBar {
title: window.title
width: window.width
height: 30
showDark: window.showDark
showClose: window.showClose
@ -87,14 +86,6 @@ Window {
}
lifecycle.onVisible(visible)
}
Component{
id:com_frameless
FluFrameless{
}
}
FluLoader{
id:loader_frameless
}
QtObject{
id:d
property bool isFirstVisible: true
@ -119,53 +110,24 @@ Window {
target: window
function onClosing(event){closeListener(event)}
}
Component{
id:com_frameless
FluFrameless{
stayTop: window.stayTop
}
}
Component{
id:com_background
Rectangle{
color: window.backgroundColor
}
}
FluLoader{
anchors.fill: parent
sourceComponent: background
}
FluLoader{
id:loader_app_bar
anchors {
top: parent.top
left: parent.left
right: parent.right
}
height: {
if(window.useSystemAppBar){
return 0
}
return window.fitsAppBarWindows ? 0 : window.appBar.height
}
sourceComponent: window.useSystemAppBar ? undefined : com_app_bar
}
Component{
id:com_app_bar
Item{
data: window.appBar
}
}
Item{
id:container
anchors{
top: loader_app_bar.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
}
clip: true
}
FluLoader{
property string loadingText: "加载中..."
property bool cancel: false
id:loader_loading
anchors.fill: container
}
Component{
id:com_loading
Popup{
@ -228,27 +190,78 @@ Window {
}
}
}
FluInfoBar{
id:infoBar
root: window
}
WindowLifecycle{
id:lifecycle
}
Rectangle{
FluLoader{
anchors.fill: parent
anchors.topMargin: FluTools.isWin() ? 1/Screen.devicePixelRatio : 0
color:"transparent"
border.width: window.resizeBorderWidth
border.color: window.resizeBorderColor
visible: {
if(window.useSystemAppBar){
return false
sourceComponent: background
}
FluLoader{
id:loader_frameless
}
Item{
id:layout_content
anchors.fill: parent
anchors.margins: {
if(FluTools.isWin()){
return window.visibility === Window.Maximized ? 8 : 0
}
if(window.visibility == Window.Maximized || window.visibility == Window.FullScreen){
return false
return 0
}
onWidthChanged: {
window.appBar.width = width
}
FluLoader{
id:loader_app_bar
anchors {
top: parent.top
left: parent.left
right: parent.right
}
height: {
if(window.useSystemAppBar){
return 0
}
return window.fitsAppBarWindows ? 0 : window.appBar.height
}
sourceComponent: window.useSystemAppBar ? undefined : com_app_bar
}
Item{
id:container
anchors{
top: loader_app_bar.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
}
clip: true
}
FluLoader{
property string loadingText: "加载中..."
property bool cancel: false
id:loader_loading
anchors.fill: container
}
FluInfoBar{
id:infoBar
root: window
}
WindowLifecycle{
id:lifecycle
}
Rectangle{
anchors.fill: parent
color:"transparent"
anchors.topMargin: FluTools.isWin() ? 1/Screen.devicePixelRatio : 0
border.width: window.resizeBorderWidth
border.color: window.resizeBorderColor
visible: {
if(window.useSystemAppBar){
return false
}
if(window.visibility == Window.Maximized || window.visibility == Window.FullScreen){
return false
}
return true
}
return true
}
}
function destoryOnClose(){