[graphics/krita] libs/ui: Default to Fusion style on Windows
Halla Rempt <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 66b63f2fe4e2d70a349d02ca3b73cc0dcbd28d6f by Halla Rempt, on behalf of Freya Lupen.
Committed on 24/07/2026 at 13:39.
Pushed by rempt into branch 'master'.
Default to Fusion style on Windows
and use System theme when switching to Vista style.
Vista style is the default on Windows if allowed,
but it uses system theming which makes other themes not work,
so it's weird to have it the default, just like with macOS style.
M +5 -4 libs/ui/KisApplication.cpp
M +3 -2 libs/ui/KisMainWindow.cpp
https://invent.kde.org/graphics/krita/-/commit/66b63f2fe4e2d70a349d02ca3b73cc0dcbd28d6f
diff --git a/libs/ui/KisApplication.cpp b/libs/ui/KisApplication.cpp
index bad4e3b610f..83f65f04234 100644
--- a/libs/ui/KisApplication.cpp
+++ b/libs/ui/KisApplication.cpp
@@ -245,16 +245,17 @@ KisApplication::KisApplication(const QString &key, int &argc, char **argv)
// if style is set from config, try to load that
KisConfig cfg(true);
QString widgetStyleFromConfig = cfg.widgetStyle();
+ QString defaultStyle = style()->objectName().toLower();
if (!widgetStyleFromConfig.isEmpty()) {
qApp->setStyle(widgetStyleFromConfig);
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
- } else if (style()->objectName().toLower() == "macintosh") {
- // if no configured style on macOS, default to Fusion
+ } else if (defaultStyle == "macintosh" || defaultStyle == "windowsvista") {
+ // default to Fusion instead of styles that use native theming
qApp->setStyle("fusion");
}
#else
- } else if (style()->objectName().toLower() == "macos") {
- // if no configured style on macOS, default to Fusion
+ } else if (style()->objectName().toLower() == "macos" || defaultStyle == "windowsvista") {
+ // default to Fusion instead of styles that use native theming
qApp->setStyle("fusion");
}
#endif
diff --git a/libs/ui/KisMainWindow.cpp b/libs/ui/KisMainWindow.cpp
index 8bc5f9f7ae5..0a86bdca4c8 100644
--- a/libs/ui/KisMainWindow.cpp
+++ b/libs/ui/KisMainWindow.cpp
@@ -2556,12 +2556,13 @@ void KisMainWindow::slotUpdateWidgetStyle()
// When switching to a style that uses system colors, reset the theme
#ifndef Q_OS_HAIKU
+ QString currentStyle = qApp->style()->objectName();
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
- if (qApp->style()->objectName() == "macintosh") {
+ if (currentStyle == "macintosh" || currentStyle == "windowsvista") {
d->themeManager->setCurrentTheme("System");
}
#else
- if (qApp->style()->name() == "macos") {
+ if (currentStyle || currentStyle == "windowsvista") {
d->themeManager->setCurrentTheme("System");
}
#endif