Skip to content

KQuickStyleItem: Fix color groups get stuck after color change event

ivan tkachenko requested to merge work/ratijas/checkbox-colors-change into master

After Kirigami Theme's colorsChanged signal controls were painted as enabled and active regardless of their actual state. This was happening due to unconditional palette override in signal handler, when in fact it has to go through all the code paths that might alter palette as during normal execution initStyleOption method.

So, in order to not get hit by the overhead of calling initStyleOption, all the palette-related code (including a special case for Item type) was factored out to a new method, and that method is now called on color changes.

Also resolvePalette method got merged with the new method and removed from public API. It wasn't used anywhere in C++ or QML, and I'm not sure why was public at all.

Last but not least, the comment in signal handler stated that palette should be set unconditionally regardless of Qt::AA_SetPalette. It says what we needed to do, but not why. I don't know why, but it doesn't seem to do any good (at the very least it should've updated color groups again based on enabled/active states).

See also: plasma/breeze#9 (comment 667644)


Note: This MR is based on !255 (merged) cleanup. It actually contains only 1 unique commit.

Merge request reports

Loading