Add modern windows style.

Took 8 minutes
This commit is contained in:
Lukas Brübach 2026-04-07 09:45:14 +02:00
parent b69062278d
commit 21bab44a6f
2 changed files with 4 additions and 13 deletions

View file

@ -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"

View file

@ -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());