From 70db5a2f92c635063501cadb840fd79eb8c765d2 Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Fri, 28 Feb 2025 21:04:31 +0000 Subject: [PATCH] Default to Fusion based Dark/Bright themes on Windows Signed-off-by: TheKodeToad (cherry picked from commit 5261b615d72eb0adbeb9c53e30b73448d722cf11) --- launcher/Application.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 1d5efe7fc..038444b3a 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -156,6 +156,7 @@ #if defined Q_OS_WIN32 #include +#include #include "WindowsConsole.h" #endif @@ -1102,8 +1103,16 @@ bool Application::createSetupWizard() // set default theme after going into theme wizard if (!validIcons) settings()->set("IconTheme", QString("pe_colored")); - if (!validWidgets) - settings()->set("ApplicationTheme", QString("system")); + if (!validWidgets) { +#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);