Qt: Add Classic Windows as theme option

But it'll bug out when switching between windows11/windowsvista.

Restart to fix.
This commit is contained in:
Stenzek 2024-04-30 21:44:07 +10:00
parent 6a02f9c67b
commit 645adad932
No known key found for this signature in database
2 changed files with 22 additions and 1 deletions

View File

@ -11,6 +11,9 @@
const char* InterfaceSettingsWidget::THEME_NAMES[] = {
QT_TRANSLATE_NOOP("MainWindow", "Native"),
#ifdef _WIN32
QT_TRANSLATE_NOOP("MainWindow", "Classic Windows"),
#endif
QT_TRANSLATE_NOOP("MainWindow", "Fusion"),
QT_TRANSLATE_NOOP("MainWindow", "Dark Fusion (Gray)"),
QT_TRANSLATE_NOOP("MainWindow", "Dark Fusion (Blue)"),
@ -22,7 +25,18 @@ const char* InterfaceSettingsWidget::THEME_NAMES[] = {
};
const char* InterfaceSettingsWidget::THEME_VALUES[] = {
"","fusion", "darkfusion", "darkfusionblue", "cobaltsky", "greymatter", "darkruby", "purplerain", nullptr,
"",
#ifdef _WIN32
"windowsvista",
#endif
"fusion",
"darkfusion",
"darkfusionblue",
"cobaltsky",
"greymatter",
"darkruby",
"purplerain",
nullptr,
};
const char* InterfaceSettingsWidget::DEFAULT_THEME_NAME = "darkfusion";

View File

@ -2428,6 +2428,13 @@ void MainWindow::setStyleFromSettings()
qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #505a70; border: 1px solid white; }");
}
#ifdef _WIN32
else if (theme == "windowsvista")
{
qApp->setStyle(QStyleFactory::create("windowsvista"));
qApp->setStyleSheet(QString());
}
#endif
else
{
qApp->setStyle(s_unthemed_style_name);