[Style] Do not offer broken windows11 (#7341)

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-09-21 21:45:11 +02:00 • committed by GitHub
parent fe83966087
commit e97ef5a617
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 3 deletions

View file

@ -95,9 +95,11 @@ struct PaletteColorInfo
static QString usableDefaultStyle(const QString &style) static QString usableDefaultStyle(const QString &style)
{ {
// The Windows 11 native style is broken: when the OS default // The Windows 11 native style is broken: dragging cards across zones can
// ("System" theme selection) would use it, fall back to the Vista style. // shrink the board to a tiny grey window that is unfixable without
// Explicitly choosing "windows11" in a theme is still honored. // rejoining. It is never usable, so guard against it no matter how it was
// requested (OS default or an explicit "windows11" theme choice) and fall
// back to the Vista style.
return style.compare("windows11", Qt::CaseInsensitive) == 0 ? QStringLiteral("windowsvista") : style; return style.compare("windows11", Qt::CaseInsensitive) == 0 ? QStringLiteral("windowsvista") : style;
} }
@ -410,6 +412,10 @@ void ThemeManager::applyStyleAndPalette(const QString &themeName,
} }
} }
// The Windows 11 style is broken even when selected explicitly in a theme,
// so sanitize the resolved name here rather than trusting the theme config.
styleName = usableDefaultStyle(styleName);
QStyle *style = QStyleFactory::create(styleName); QStyle *style = QStyleFactory::create(styleName);
if (!style) { if (!style) {
style = QStyleFactory::create(usableDefaultStyle(defaultStyleName)); style = QStyleFactory::create(usableDefaultStyle(defaultStyleName));

View file

@ -62,6 +62,12 @@ AppearanceSettingsPage::AppearanceSettingsPage()
// Qt widget style; "System" lets the application decide // Qt widget style; "System" lets the application decide
styleCombo.addItem(tr("System"), QStringLiteral("System")); styleCombo.addItem(tr("System"), QStringLiteral("System"));
for (const QString &key : QStyleFactory::keys()) { for (const QString &key : QStyleFactory::keys()) {
// The Windows 11 native style is broken (board rendering glitches when
// moving cards), so never offer it; it is already sanitized at apply
// time in ThemeManager.
if (key.compare("windows11", Qt::CaseInsensitive) == 0) {
continue;
}
styleCombo.addItem(key, key); styleCombo.addItem(key, key);
} }