main
zhuzihcu 2023-06-08 10:17:49 +08:00
parent ebed19b130
commit 3fa54b37c1
2 changed files with 22 additions and 12 deletions

View File

@ -5,9 +5,10 @@
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
#include <QStyleHints>
#elif ((QT_VERSION >= QT_VERSION_CHECK(6, 2, 1)))
#include <QPalette>
#include <QtGui/qpa/qplatformtheme.h>
#include <QtGui/private/qguiapplication_p.h>
#else
#include <QPalette>
#endif
#include <QGuiApplication>
@ -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(){

View File

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