main
朱子楚\zhuzi 2023-06-06 21:02:33 +08:00
parent b4f9f32195
commit d55874f01e
2 changed files with 17 additions and 3 deletions

View File

@ -42,7 +42,7 @@ jobs:
version: ${{ matrix.qt_ver }}
arch: ${{ matrix.qt_arch }}
cache: ${{steps.cache-qt.outputs.cache-hit}}
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats'
modules: 'qt5compat qtmultimedia qtshadertools qtimageformats qtspeech'
- name: msvc-build
id: build

View File

@ -2,8 +2,14 @@
#include "Def.h"
#include "FluColors.h"
#include <QPalette>
#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>
#endif
#include <QGuiApplication>
FluTheme* FluTheme::m_instance = nullptr;
@ -44,7 +50,15 @@ bool FluTheme::eventFilter(QObject *obj, QEvent *event)
bool FluTheme::systemDark()
{
return QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark;
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
return (QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark);
#elif ((QT_VERSION >= QT_VERSION_CHECK(6, 2, 1)))
if (const QPlatformTheme * const theme = QGuiApplicationPrivate::platformTheme()) {
return (theme->appearance() == QPlatformTheme::Appearance::Dark);
}
return false;
#endif
return false;
}
bool FluTheme::dark(){