Remove stylesheet in PageView so it reacts to colors and fonts changes
ClosedPublic

Authored by dfaure on Jul 20 2019, 10:34 AM.

Details

Summary

The stylesheet was added to hide what looks like an expand/close indicator
on a tree that is always expanded (setItemsExpandable(false)).

On the other hand, the use of a stylesheet at all introduced these two
bugs: changing the font globally (kcmshell5 fonts) or the colors
(kcmshell5 color) would work on most of zanshin EXCEPT on the treeview
in the middle, which kept the old palette or the old font. Awful.

Redone with a proxy style to avoid these issues.

Test Plan

kcmshell5 colors now applies the colors to all of zanshin

Diff Detail

Repository
R4 Zanshin
Branch
remove_stylesheet
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 14173
Build 14191: arc lint + arc unit
dfaure requested review of this revision.Jul 20 2019, 10:34 AM
dfaure created this revision.
ervin added a comment.Jul 20 2019, 1:59 PM

Honestly, I'm not too thrilled about that. I'm surprised about the mentioned bugs from stylesheets though, I thought it was proxying to the real style nowadays?

Any alternative to not having those rendered? It's a question of visual clutter.

It is proxying the real style (it always has been), but it sets a custom palette and font, at creation time, which breaks reacting to changes to those.
(proof, see QStyleSheetStyle::polish => QStyleSheetStyle::setPalette => w->setPalette(p))

We could listen to QEvent::ApplicationPaletteChange but since stylesheets also break QWidget::setPalette, we would probably have to unset and set the stylesheet again. Horrible. One of the many reasons why I hate stylesheets.

Ah, hmm, the alternative is a proper proxy style, without the stylesheet crap.

ervin added a comment.Jul 20 2019, 2:50 PM

Oh, right, so it follows styling but just doesn't react to change. It's minor enough that I'd be willing to just ignore it. Otherwise we're good for the proxy style route...

dfaure updated this revision to Diff 62124.Jul 20 2019, 2:56 PM
dfaure edited the summary of this revision. (Show Details)

Redone with a proxy style.

We want nothing, right? No close icon, but also no lines connecting parent and child?

ervin added a comment.Jul 20 2019, 3:15 PM

We want nothing, right? No close icon, but also no lines connecting parent and child?

Exactly

ervin accepted this revision.Jul 20 2019, 3:16 PM
This revision is now accepted and ready to land.Jul 20 2019, 3:16 PM
dfaure closed this revision.Jul 20 2019, 3:21 PM