mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 17:13:57 -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/qopensslbackend.dll"
|
||||||
PATTERN "styles/qschannelbackend.dll"
|
PATTERN "styles/qschannelbackend.dll"
|
||||||
PATTERN "styles/qwindowsvistastyle.dll"
|
PATTERN "styles/qwindowsvistastyle.dll"
|
||||||
|
PATTERN "styles/qwindows11style.dll"
|
||||||
|
PATTERN "styles/qmodernwindowsstyle.dll"
|
||||||
|
PATTERN "styles/qmodernwindowsstyled.dll"
|
||||||
PATTERN "tls/qcertonlybackend.dll"
|
PATTERN "tls/qcertonlybackend.dll"
|
||||||
PATTERN "tls/qopensslbackend.dll"
|
PATTERN "tls/qopensslbackend.dll"
|
||||||
PATTERN "tls/qschannelbackend.dll"
|
PATTERN "tls/qschannelbackend.dll"
|
||||||
|
|
|
||||||
|
|
@ -348,19 +348,7 @@ void ThemeManager::themeChangedSlot()
|
||||||
qApp->setStyle(QStyleFactory::create("Fusion"));
|
qApp->setStyle(QStyleFactory::create("Fusion"));
|
||||||
qApp->setPalette(createDarkGreenFusionPalette());
|
qApp->setPalette(createDarkGreenFusionPalette());
|
||||||
} else {
|
} else {
|
||||||
qApp->setStyle(nullptr); // setting the style also sets the palette
|
qApp->setStyle(defaultStyleName); // 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
|
|
||||||
qInfo() << "Available styles:" << QStyleFactory::keys();
|
qInfo() << "Available styles:" << QStyleFactory::keys();
|
||||||
qInfo() << "Plugin paths:" << QCoreApplication::libraryPaths();
|
qInfo() << "Plugin paths:" << QCoreApplication::libraryPaths();
|
||||||
qApp->setPalette(QPalette());
|
qApp->setPalette(QPalette());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue