From bd3ed12c445c2f711ac0ba0cbb009f697cc4c384 Mon Sep 17 00:00:00 2001 From: Bionus Date: Sun, 12 May 2024 22:21:57 +0200 Subject: [PATCH] fix: default to Qt Vista style on Windows --- src/gui/src/main-window.cpp | 2 +- src/gui/src/settings/options-window.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/src/main-window.cpp b/src/gui/src/main-window.cpp index e000c55cf..7033c0217 100644 --- a/src/gui/src/main-window.cpp +++ b/src/gui/src/main-window.cpp @@ -82,7 +82,7 @@ void MainWindow::init(const QStringList &args, const QMap &par m_themeLoader = new ThemeLoader(savePath("themes/", true, false), m_settings, this); m_themeLoader->setTheme(m_settings->value("theme", "Default").toString()); const QStringList baseStyles = QStyleFactory::keys(); - const QString defaultStyle = !baseStyles.isEmpty() ? baseStyles.first() : ""; + const QString defaultStyle = !baseStyles.isEmpty() ? (baseStyles.contains("windowsvista") ? "windowsvista" : baseStyles.first()) : ""; qApp->setStyle(m_settings->value("baseStyle", defaultStyle).toString()); ui->setupUi(this); diff --git a/src/gui/src/settings/options-window.cpp b/src/gui/src/settings/options-window.cpp index 981149eb7..2ffed817c 100644 --- a/src/gui/src/settings/options-window.cpp +++ b/src/gui/src/settings/options-window.cpp @@ -386,7 +386,7 @@ OptionsWindow::OptionsWindow(Profile *profile, ThemeLoader *themeLoader, QWidget } ui->comboTheme->setCurrentText(settings->value("theme", "Default").toString()); const QStringList baseStyles = QStyleFactory::keys(); - const QString defaultStyle = !baseStyles.isEmpty() ? baseStyles.first() : ""; + const QString defaultStyle = !baseStyles.isEmpty() ? (baseStyles.contains("windowsvista") ? "windowsvista" : baseStyles.first()) : ""; for (const QString &style : baseStyles) { ui->comboBaseStyle->addItem(style, style); }