mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-07 05:53:59 -07:00
Descend in preference on windows.
Took 9 minutes
This commit is contained in:
parent
60c94eb982
commit
0a6c63b167
1 changed files with 12 additions and 0 deletions
|
|
@ -349,6 +349,18 @@ void ThemeManager::themeChangedSlot()
|
|||
qApp->setPalette(createDarkGreenFusionPalette());
|
||||
} else if (themeName == NONE_THEME_NAME) {
|
||||
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->setPalette(QPalette());
|
||||
} else {
|
||||
qApp->setStyle(defaultStyleName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue