From 3fa54b37c1595a0740a5df86d07191ba5adc6717 Mon Sep 17 00:00:00 2001 From: zhuzihcu Date: Thu, 8 Jun 2023 10:17:49 +0800 Subject: [PATCH] update --- src/FluTheme.cpp | 8 +++++-- src/imports/FluentUI/Controls/FluPopup.qml | 26 +++++++++++++--------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/FluTheme.cpp b/src/FluTheme.cpp index 4372d97..7ab80d2 100644 --- a/src/FluTheme.cpp +++ b/src/FluTheme.cpp @@ -5,9 +5,10 @@ #if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)) #include #elif ((QT_VERSION >= QT_VERSION_CHECK(6, 2, 1))) -#include #include #include +#else +#include #endif #include @@ -57,8 +58,11 @@ bool FluTheme::systemDark() return (theme->appearance() == QPlatformTheme::Appearance::Dark); } return false; +#else + QPalette palette = qApp->palette(); + QColor color = palette.color(QPalette::Window).rgb(); + return !(color.red() * 0.2126 + color.green() * 0.7152 + color.blue() * 0.0722 > 255 / 2); #endif - return false; } bool FluTheme::dark(){ diff --git a/src/imports/FluentUI/Controls/FluPopup.qml b/src/imports/FluentUI/Controls/FluPopup.qml index addb988..538138e 100644 --- a/src/imports/FluentUI/Controls/FluPopup.qml +++ b/src/imports/FluentUI/Controls/FluPopup.qml @@ -15,26 +15,32 @@ Popup { property alias blurOpacity: blur.acrylicOpacity property alias blurRectX: blur.rectX property alias blurRectY: blur.rectY - enter: Transition { - reversible: true NumberAnimation { - properties: "opacity,scale" + properties: "scale" + from:1.2 + to:1 + duration: 83 + } + NumberAnimation { + property: "opacity" + duration: 83 from:0 to:1 - duration: 167 - easing.type: Easing.BezierSpline - easing.bezierCurve: [ 0, 0, 0, 1 ] } } exit:Transition { NumberAnimation { - properties: "opacity,scale" + properties: "scale" + from:1 + to:1.2 + duration: 83 + } + NumberAnimation { + property: "opacity" + duration: 83 from:1 to:0 - duration: 167 - easing.type: Easing.BezierSpline - easing.bezierCurve: [ 1, 0, 0, 0 ] } }