This commit is contained in:
朱子楚\zhuzi
2023-06-06 20:45:25 +08:00
parent cf9ffbe0ca
commit b4f9f32195
5 changed files with 10 additions and 14 deletions

View File

@ -3,8 +3,7 @@
#include "Def.h"
#include "FluColors.h"
#include <QPalette>
#include <QtGui/qpa/qplatformtheme.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QStyleHints>
#include <QGuiApplication>
FluTheme* FluTheme::m_instance = nullptr;
@ -45,10 +44,7 @@ bool FluTheme::eventFilter(QObject *obj, QEvent *event)
bool FluTheme::systemDark()
{
if (const QPlatformTheme * const theme = QGuiApplicationPrivate::platformTheme()) {
return (theme->appearance() == QPlatformTheme::Appearance::Dark);
}
return false;
return QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark;
}
bool FluTheme::dark(){