diff --git a/example/qml-Qt6/page/T_Settings.qml b/example/qml-Qt6/page/T_Settings.qml index 24d5d23f..6ee2a234 100644 --- a/example/qml-Qt6/page/T_Settings.qml +++ b/example/qml-Qt6/page/T_Settings.qml @@ -88,6 +88,20 @@ FluScrollablePage{ } } + FluArea{ + Layout.fillWidth: true + Layout.topMargin: 20 + height: 50 + paddings: 10 + FluCheckBox{ + text:"fitsAppBarWindows" + checked: window.fitsAppBarWindows + anchors.verticalCenter: parent.verticalCenter + onClicked: { + window.fitsAppBarWindows = !window.fitsAppBarWindows + } + } + } FluArea{ Layout.fillWidth: true @@ -215,5 +229,4 @@ FluScrollablePage{ } } } - } diff --git a/example/qml-Qt6/window/MainWindow.qml b/example/qml-Qt6/window/MainWindow.qml index 84adb6d7..80b2c558 100644 --- a/example/qml-Qt6/window/MainWindow.qml +++ b/example/qml-Qt6/window/MainWindow.qml @@ -41,8 +41,11 @@ FluWindow { } } - Component.onCompleted: { + onFirstVisible: { tour.open() + } + + Component.onCompleted: { checkUpdate(true) FluEventBus.registerEvent(event_checkupdate) } @@ -239,7 +242,7 @@ FluWindow { } function handleDarkChanged(button){ - if(!FluTheme.enableAnimation){ + if(!FluTheme.enableAnimation || window.fitsAppBarWindows === false){ changeDark() }else{ loader_reveal.sourceComponent = com_reveal diff --git a/example/qml/page/T_Settings.qml b/example/qml/page/T_Settings.qml index 85c95097..e06b5f43 100644 --- a/example/qml/page/T_Settings.qml +++ b/example/qml/page/T_Settings.qml @@ -91,6 +91,21 @@ FluScrollablePage{ } } + FluArea{ + Layout.fillWidth: true + Layout.topMargin: 20 + height: 50 + paddings: 10 + FluCheckBox{ + text:"fitsAppBarWindows" + checked: window.fitsAppBarWindows + anchors.verticalCenter: parent.verticalCenter + onClicked: { + window.fitsAppBarWindows = !window.fitsAppBarWindows + } + } + } + FluArea{ Layout.fillWidth: true Layout.topMargin: 20 @@ -217,5 +232,4 @@ FluScrollablePage{ } } } - } diff --git a/example/qml/window/MainWindow.qml b/example/qml/window/MainWindow.qml index d844c7cb..4b964f79 100644 --- a/example/qml/window/MainWindow.qml +++ b/example/qml/window/MainWindow.qml @@ -44,8 +44,11 @@ FluWindow { } } - Component.onCompleted: { + onFirstVisible: { tour.open() + } + + Component.onCompleted: { checkUpdate(true) FluEventBus.registerEvent(event_checkupdate) } @@ -242,7 +245,7 @@ FluWindow { } function handleDarkChanged(button){ - if(!FluTheme.enableAnimation){ + if(!FluTheme.enableAnimation || window.fitsAppBarWindows === false){ changeDark() }else{ loader_reveal.sourceComponent = com_reveal diff --git a/src/Qt5/imports/FluentUI/Controls/FluWindow.qml b/src/Qt5/imports/FluentUI/Controls/FluWindow.qml index 0058bd74..b6f0263e 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluWindow.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluWindow.qml @@ -49,6 +49,7 @@ Window { } } signal initArgument(var argument) + signal firstVisible() id:window maximumWidth: useSystemAppBar&&fixSize ? width : 16777215 maximumHeight: useSystemAppBar&&fixSize ? height : 16777215 @@ -76,10 +77,15 @@ Window { lifecycle.onDestruction() } onVisibleChanged: { + if(visible && d.isFirstVisible){ + window.firstVisible() + d.isFirstVisible = false + } lifecycle.onVisible(visible) } QtObject{ id:d + property bool isFirstVisible: true function changedStayTop(){ function toggleStayTop(){ if(window.stayTop){ @@ -118,13 +124,18 @@ Window { left: parent.left right: parent.right } - sourceComponent: window.useSystemAppBar ? undefined : com_app_bar + sourceComponent: FluApp.useSystemAppBar ? undefined : com_app_bar } Component{ id:com_app_bar Item{ data: window.appBar - height: window.fitsAppBarWindows ? 0 : childrenRect.height + height: { + if(FluApp.useSystemAppBar){ + return 0 + } + return window.fitsAppBarWindows ? 0 : childrenRect.height + } } } Item{ @@ -243,7 +254,7 @@ Window { id:loader_window_border anchors.fill: parent z:999 - sourceComponent: window.useSystemAppBar ? undefined : com_window_border + sourceComponent: FluApp.useSystemAppBar ? undefined : com_window_border } Component{ id:com_window_border @@ -301,4 +312,7 @@ Window { _pageRegister.onResult(data) } } + function containerItem(){ + return container + } } diff --git a/src/Qt6/imports/FluentUI/Controls/FluWindow.qml b/src/Qt6/imports/FluentUI/Controls/FluWindow.qml index 532fa385..9bdd6711 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluWindow.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluWindow.qml @@ -48,6 +48,7 @@ Window { } } signal initArgument(var argument) + signal firstVisible() id:window maximumWidth: useSystemAppBar&&fixSize ? width : 16777215 maximumHeight: useSystemAppBar&&fixSize ? height : 16777215 @@ -75,10 +76,15 @@ Window { lifecycle.onDestruction() } onVisibleChanged: { + if(visible && d.isFirstVisible){ + window.firstVisible() + d.isFirstVisible = false + } lifecycle.onVisible(visible) } QtObject{ id:d + property bool isFirstVisible: true function changedStayTop(){ function toggleStayTop(){ if(window.stayTop){ @@ -117,13 +123,18 @@ Window { left: parent.left right: parent.right } - sourceComponent: window.useSystemAppBar ? undefined : com_app_bar + sourceComponent: FluApp.useSystemAppBar ? undefined : com_app_bar } Component{ id:com_app_bar Item{ data: window.appBar - height: window.fitsAppBarWindows ? 0 : childrenRect.height + height: { + if(FluApp.useSystemAppBar){ + return 0 + } + return window.fitsAppBarWindows ? 0 : childrenRect.height + } } } Item{ @@ -242,7 +253,7 @@ Window { id:loader_window_border anchors.fill: parent z:999 - sourceComponent: window.useSystemAppBar ? undefined : com_window_border + sourceComponent: FluApp.useSystemAppBar ? undefined : com_window_border } Component{ id:com_window_border @@ -300,4 +311,7 @@ Window { _pageRegister.onResult(data) } } + function containerItem(){ + return container + } }