[Backport release-9.x] Default to Fusion based Dark/Bright themes on Windows (#3457)
This commit is contained in:
commit
0073d82863
@ -156,6 +156,7 @@
|
|||||||
|
|
||||||
#if defined Q_OS_WIN32
|
#if defined Q_OS_WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <QStyleHints>
|
||||||
#include "WindowsConsole.h"
|
#include "WindowsConsole.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1102,8 +1103,16 @@ bool Application::createSetupWizard()
|
|||||||
// set default theme after going into theme wizard
|
// set default theme after going into theme wizard
|
||||||
if (!validIcons)
|
if (!validIcons)
|
||||||
settings()->set("IconTheme", QString("pe_colored"));
|
settings()->set("IconTheme", QString("pe_colored"));
|
||||||
if (!validWidgets)
|
if (!validWidgets) {
|
||||||
settings()->set("ApplicationTheme", QString("system"));
|
#if defined(Q_OS_WIN32) && QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||||
|
const QString style =
|
||||||
|
QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark ? QStringLiteral("dark") : QStringLiteral("bright");
|
||||||
|
#else
|
||||||
|
const QString style = QStringLiteral("system");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
settings()->set("ApplicationTheme", style);
|
||||||
|
}
|
||||||
|
|
||||||
m_themeManager->applyCurrentlySelectedTheme(true);
|
m_themeManager->applyCurrentlySelectedTheme(true);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user