From fc618e96c52a550d05324f1151ab9fcd40c67d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Sat, 21 Oct 2023 22:03:26 +0800 Subject: [PATCH] update --- framelesshelper | 2 +- .../imports/FluentUI/Controls/FluWindow.qml | 24 +++++++++++-------- .../imports/FluentUI/Controls/FluWindow.qml | 24 +++++++++++-------- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/framelesshelper b/framelesshelper index 80f869ad..c4a7bc80 160000 --- a/framelesshelper +++ b/framelesshelper @@ -1 +1 @@ -Subproject commit 80f869adcaf7db76ba8088f2c16382dcd5feaafb +Subproject commit c4a7bc80d0ca0b1b87418515ab4836f3d4944ae0 diff --git a/src/Qt5/imports/FluentUI/Controls/FluWindow.qml b/src/Qt5/imports/FluentUI/Controls/FluWindow.qml index 8afdf732..9b98bd8b 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluWindow.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluWindow.qml @@ -14,7 +14,6 @@ Window { property bool fixSize: false property Component loadingItem: com_loading property var appBar: com_app_bar - flags: Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint property color backgroundColor: { if(active){ return FluTheme.dark ? Qt.rgba(26/255,34/255,40/255,1) : Qt.rgba(243/255,243/255,243/255,1) @@ -34,6 +33,7 @@ Window { } signal initArgument(var argument) id:window + flags: Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint color:"transparent" onStayTopChanged: { d.changedStayTop() @@ -49,19 +49,23 @@ Window { onVisibleChanged: { lifecycle.onVisible(visible) } - onVisibilityChanged: { - console.debug(visibility) - } QtObject{ id:d function changedStayTop(){ - var visibility = window.visibility - if(window.stayTop){ - window.flags = window.flags | Qt.WindowStaysOnTopHint - }else{ - window.flags = window.flags &~ Qt.WindowStaysOnTopHint + function toggleStayTop(){ + if(window.stayTop){ + window.flags = window.flags | Qt.WindowStaysOnTopHint + }else{ + window.flags = window.flags &~ Qt.WindowStaysOnTopHint + } + } + if(window.visibility === Window.Maximized){ + window.visibility = Window.Windowed + toggleStayTop() + window.visibility = Window.Maximized + }else{ + toggleStayTop() } - window.visibility = visibility } } Connections{ diff --git a/src/Qt6/imports/FluentUI/Controls/FluWindow.qml b/src/Qt6/imports/FluentUI/Controls/FluWindow.qml index 3584274e..afd14afa 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluWindow.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluWindow.qml @@ -13,7 +13,6 @@ Window { property bool fixSize: false property Component loadingItem: com_loading property var appBar: com_app_bar - flags: Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint property color backgroundColor: { if(active){ return FluTheme.dark ? Qt.rgba(26/255,34/255,40/255,1) : Qt.rgba(243/255,243/255,243/255,1) @@ -33,6 +32,7 @@ Window { } signal initArgument(var argument) id:window + flags: Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint color:"transparent" onStayTopChanged: { d.changedStayTop() @@ -48,19 +48,23 @@ Window { onVisibleChanged: { lifecycle.onVisible(visible) } - onVisibilityChanged: { - console.debug(visibility) - } QtObject{ id:d function changedStayTop(){ - var visibility = window.visibility - if(window.stayTop){ - window.flags = window.flags | Qt.WindowStaysOnTopHint - }else{ - window.flags = window.flags &~ Qt.WindowStaysOnTopHint + function toggleStayTop(){ + if(window.stayTop){ + window.flags = window.flags | Qt.WindowStaysOnTopHint + }else{ + window.flags = window.flags &~ Qt.WindowStaysOnTopHint + } + } + if(window.visibility === Window.Maximized){ + window.visibility = Window.Windowed + toggleStayTop() + window.visibility = Window.Maximized + }else{ + toggleStayTop() } - window.visibility = visibility } } Connections{