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 ] } }