mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 16:13:54 -07:00
Don't bleed through previous themes.
Took 3 minutes
This commit is contained in:
parent
d8be3dae9c
commit
e6a5461dad
1 changed files with 11 additions and 1 deletions
|
|
@ -344,7 +344,17 @@ void ThemeManager::applyStyleAndPalette(const QString &themeName,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
base = qApp->palette();
|
// Always start from the style's own standard palette so a previously-applied
|
||||||
|
// theme can never bleed through. qApp->palette() carries the result of the
|
||||||
|
// last theme application and must not be used as a base here — if the current
|
||||||
|
// theme ships no palette file, hasPalette() is false and palCfg.apply() is
|
||||||
|
// skipped, meaning whatever we put in base IS the effective palette.
|
||||||
|
base = style->standardPalette();
|
||||||
|
if (!base.color(QPalette::Window).isValid()) {
|
||||||
|
// Exotic platform style that doesn't implement standardPalette() —
|
||||||
|
// accept the bleed-through risk rather than crash or use garbage.
|
||||||
|
base = qApp->palette();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overlay custom palette colours
|
// Overlay custom palette colours
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue