mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-07 05:53:59 -07:00
Add modern windows style.
Took 8 minutes
This commit is contained in:
parent
b69062278d
commit
21bab44a6f
2 changed files with 4 additions and 13 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue