diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2024-05-02 17:57:28 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2024-05-03 14:04:51 +0200 |
commit | 5cdac10b4680e0984f490f1606f212f1d38ab5f7 (patch) | |
tree | 026c44c5edc19c810bb0a5dcf53249feb484525e /src/corelib/serialization/qdatastream.cpp | |
parent | cee94658d686d22d28a1fef849eb916e494e67e2 (diff) |
Windows 11 style: simplify code to polish palette
There are two cases in which we let the style polish a palette:
- after merging the system palette and the style's standard palette
- or when a widget-class specific palette gets set
A style needs to know which colors of the palette it can safely
overwrite with style-specific preferences. For that to work, we
need to reset the resolve mask of the synthesized palette (first
case) to 0 before polishing. Palettes set explicitly by application
code will then have resolve bits set, and the polishing can
respect those colors and not overwrite them.
Simplify the polish() implementation then to check whether the
respective color's resolve bit is set, and only overwrite it with
the style's preferred color if the bit is clear. Move that logic
into a macro for simplification.
This amends b733d31f275d09ca81b5e347ca1e9b6c9b216cd4 and makes
sure that colors that are set by the application explicitly don't
get overridden by the style.
Task-number: QTBUG-124490
Task-number: QTBUG-124286
Change-Id: I69e1e3da93f661ebdafee0b62adbb3d411322443
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src/corelib/serialization/qdatastream.cpp')
0 files changed, 0 insertions, 0 deletions