From 94c0356c25d19c5ff828cb379f01b6731ca07a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Sun, 23 Apr 2023 18:08:20 +0800 Subject: [PATCH] update --- example/src/main.cpp | 2 +- src/controls/FluArea.qml | 17 +++++++++++++++-- src/controls/FluDivider.qml | 3 ++- src/controls/FluExpander.qml | 17 +++++++++++++++-- src/controls/FluNavigationView.qml | 2 +- src/controls/FluWindow.qml | 2 +- 6 files changed, 35 insertions(+), 8 deletions(-) diff --git a/example/src/main.cpp b/example/src/main.cpp index 1e587db..8851e74 100644 --- a/example/src/main.cpp +++ b/example/src/main.cpp @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) return 0; } if(ipc.isAttached()){ - ipc.registerEventHandler(activeWindowEvent,[&appInfo](const QByteArray& data){ + ipc.registerEventHandler(activeWindowEvent,[&appInfo](const QByteArray&){ Q_EMIT appInfo->activeWindow(); return true; }); diff --git a/src/controls/FluArea.qml b/src/controls/FluArea.qml index 5959059..26ec4e8 100644 --- a/src/controls/FluArea.qml +++ b/src/controls/FluArea.qml @@ -1,5 +1,6 @@ import QtQuick import QtQuick.Controls +import QtQuick.Window import FluentUI Rectangle { @@ -12,12 +13,24 @@ Rectangle { property int bottomPadding : 0 radius: 4 - color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1) - border.color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1) + color: FluTheme.dark ? Window.active ? Qt.rgba(38/255,44/255,54/255,1) : Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1) + border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1) border.width: 1 implicitHeight: height implicitWidth: width + Behavior on color{ + ColorAnimation { + duration: 300 + } + } + + Behavior on border.color{ + ColorAnimation { + duration: 300 + } + } + Item { id: container anchors.fill: parent diff --git a/src/controls/FluDivider.qml b/src/controls/FluDivider.qml index 429505b..e129e16 100644 --- a/src/controls/FluDivider.qml +++ b/src/controls/FluDivider.qml @@ -1,9 +1,10 @@ import QtQuick +import QtQuick.Window import FluentUI Rectangle { - color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,230/255,234/255,1) + color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,230/255,234/255,1) Behavior on color{ ColorAnimation { diff --git a/src/controls/FluExpander.qml b/src/controls/FluExpander.qml index 279f0a3..46f21d8 100644 --- a/src/controls/FluExpander.qml +++ b/src/controls/FluExpander.qml @@ -1,5 +1,6 @@ import QtQuick import QtQuick.Controls +import QtQuick.Window import FluentUI Item { @@ -20,8 +21,20 @@ Item { width: parent.width height: 45 radius: 4 - color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1) - border.color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1) + color: FluTheme.dark ? Window.active ? Qt.rgba(38/255,44/255,54/255,1) : Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1) + border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1) : Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1) + + Behavior on color{ + ColorAnimation { + duration: 300 + } + } + + Behavior on border.color{ + ColorAnimation { + duration: 300 + } + } MouseArea{ id:root_mouse diff --git a/src/controls/FluNavigationView.qml b/src/controls/FluNavigationView.qml index df92a57..f0f745e 100644 --- a/src/controls/FluNavigationView.qml +++ b/src/controls/FluNavigationView.qml @@ -621,7 +621,7 @@ Item { return FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(243/255,243/255,243/255,1) } if(window && window.active){ - return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(238/255,244/255,249/255,1) + return FluTheme.dark ? Qt.rgba(26/255,34/255,41/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) } diff --git a/src/controls/FluWindow.qml b/src/controls/FluWindow.qml index 20edd7c..b649949 100644 --- a/src/controls/FluWindow.qml +++ b/src/controls/FluWindow.qml @@ -32,7 +32,7 @@ ApplicationWindow { background: Rectangle{ color: { if(active){ - return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(238/255,244/255,249/255,1) + 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) }