mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 09:35:08 -07:00
[Style] Do not offer broken windows11 (#7341)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
fe83966087
commit
e97ef5a617
2 changed files with 15 additions and 3 deletions
|
|
@ -95,9 +95,11 @@ struct PaletteColorInfo
|
|||
|
||||
static QString usableDefaultStyle(const QString &style)
|
||||
{
|
||||
// The Windows 11 native style is broken: when the OS default
|
||||
// ("System" theme selection) would use it, fall back to the Vista style.
|
||||
// Explicitly choosing "windows11" in a theme is still honored.
|
||||
// The Windows 11 native style is broken: dragging cards across zones can
|
||||
// shrink the board to a tiny grey window that is unfixable without
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
|
@ -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);
|
||||
if (!style) {
|
||||
style = QStyleFactory::create(usableDefaultStyle(defaultStyleName));
|
||||
|
|
|
|||
|
|
@ -62,6 +62,12 @@ AppearanceSettingsPage::AppearanceSettingsPage()
|
|||
// Qt widget style; "System" lets the application decide
|
||||
styleCombo.addItem(tr("System"), QStringLiteral("System"));
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue