From 848026712751a0b91e75d32cc9efd8351577e393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Thu, 18 May 2023 23:24:53 +0800 Subject: [PATCH] update --- src/FluGlobal.cpp | 2 +- src/imports/FluentUI/Controls/FluAppBar.qml | 24 +++++++++++---------- src/imports/FluentUI/Controls/FluWindow.qml | 3 +++ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/FluGlobal.cpp b/src/FluGlobal.cpp index 5d686d4..52d31b1 100644 --- a/src/FluGlobal.cpp +++ b/src/FluGlobal.cpp @@ -18,7 +18,7 @@ void postInit(){ qDebug()<<"postInit"; FramelessHelper::Core::setApplicationOSThemeAware(); FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow); -// FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial); + FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial); } void initEngine(QQmlApplicationEngine* engine){ qDebug()<<"initEngine"; diff --git a/src/imports/FluentUI/Controls/FluAppBar.qml b/src/imports/FluentUI/Controls/FluAppBar.qml index da6f740..feae0e0 100644 --- a/src/imports/FluentUI/Controls/FluAppBar.qml +++ b/src/imports/FluentUI/Controls/FluAppBar.qml @@ -23,17 +23,7 @@ Rectangle{ property bool isMac: FluTools.isMacos() property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark id:root - color: { - if(active){ - return FluTheme.dark ? Qt.rgba(26/255,34/255,40/255,1) : Qt.rgba(238/255,244/255,249/255,1) - } - return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1) - } - Behavior on color{ - ColorAnimation { - duration: 300 - } - } + color: Qt.rgba(0,0,0,0) height: visible ? 30 : 0 opacity: visible z: 65535 @@ -63,6 +53,18 @@ Rectangle{ visible: root.titleVisible color:root.textColor } + //临时解决方案,加个背景挡住系统按钮 + Rectangle{ + width: 120 + height: root.height + anchors.right: parent.right + color:{ + if(active){ + return FluTheme.dark ? Qt.rgba(26/255,34/255,40/255,1) : Qt.rgba(238/255,244/255,249/255,1) + } + return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1) + } + } RowLayout{ anchors.right: parent.right height: root.height diff --git a/src/imports/FluentUI/Controls/FluWindow.qml b/src/imports/FluentUI/Controls/FluWindow.qml index 09d5fd8..aacfeda 100644 --- a/src/imports/FluentUI/Controls/FluWindow.qml +++ b/src/imports/FluentUI/Controls/FluWindow.qml @@ -81,6 +81,9 @@ Window { id:framless_helper onReady: { setTitleBarItem(title_bar) + title_bar.maximizeButton.visible = false + title_bar.minimizeButton.visible = false + title_bar.closeButton.visible = false framless_helper.moveWindowToDesktopCenter() setHitTestVisible(title_bar.minimizeButton()) setHitTestVisible(title_bar.maximizeButton())