From 21bab44a6f7c26f505d37fbd6e72926bd899bdf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Tue, 7 Apr 2026 09:45:14 +0200 Subject: [PATCH] Add modern windows style. Took 8 minutes --- cockatrice/CMakeLists.txt | 3 +++ cockatrice/src/interface/theme_manager.cpp | 14 +------------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/cockatrice/CMakeLists.txt b/cockatrice/CMakeLists.txt index 1ca3c77c2..12733afe6 100644 --- a/cockatrice/CMakeLists.txt +++ b/cockatrice/CMakeLists.txt @@ -564,6 +564,9 @@ if(WIN32) PATTERN "styles/qopensslbackend.dll" PATTERN "styles/qschannelbackend.dll" PATTERN "styles/qwindowsvistastyle.dll" + PATTERN "styles/qwindows11style.dll" + PATTERN "styles/qmodernwindowsstyle.dll" + PATTERN "styles/qmodernwindowsstyled.dll" PATTERN "tls/qcertonlybackend.dll" PATTERN "tls/qopensslbackend.dll" PATTERN "tls/qschannelbackend.dll" diff --git a/cockatrice/src/interface/theme_manager.cpp b/cockatrice/src/interface/theme_manager.cpp index 08a2b6f4f..cd5ccec11 100644 --- a/cockatrice/src/interface/theme_manager.cpp +++ b/cockatrice/src/interface/theme_manager.cpp @@ -348,19 +348,7 @@ void ThemeManager::themeChangedSlot() qApp->setStyle(QStyleFactory::create("Fusion")); qApp->setPalette(createDarkGreenFusionPalette()); } else { - qApp->setStyle(nullptr); // setting the style also sets the palette -#ifdef Q_OS_WIN - QStringList preferred = {"windows11", "windowsmodern", "windowsvista", "windowsxp", "Windows"}; - - QStringList available = QStyleFactory::keys(); - - for (const QString &styleName : preferred) { - if (available.contains(styleName, Qt::CaseInsensitive)) { - qApp->setStyle(QStyleFactory::create(styleName)); - break; - } - } -#endif + qApp->setStyle(defaultStyleName); // setting the style also sets the palette qInfo() << "Available styles:" << QStyleFactory::keys(); qInfo() << "Plugin paths:" << QCoreApplication::libraryPaths(); qApp->setPalette(QPalette());