[Breeze Style] Fix flickering during KPageTreeView animation
ClosedPublic

Authored by broulik on Aug 3 2017, 9:51 AM.

Details

Summary

QTreeView animates expanding/collapsing of branches. It renders the widget into a temporary pixmap for speed which is then animated. The pixmap's background, however, is unconditionally filled with the widget's palette's base color which is different from the window background color onto which we paint when side panel frames are disabled.

This leads to flickering as the background is different during the animation. Depending on the colorscheme can be quite noticeable (e.g. Honeycomb).

Test Plan

In Kate's settings dialog, expanded and collapsed some trees, background is consistent now. Tried with various colorschemes and background was always good and tree lines and text remained readable. Also verified that with side panel frame enabled it still works and that regular QTreeView isn't affected.

Before


After

Diff Detail

Repository
R31 Breeze
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Aug 3 2017, 9:51 AM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 3 2017, 9:51 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kstyle/breezestyle.cpp
407

Setting palettes manually is always somewhat dangerous, (can break child widgets for instance, which would inherit this palette).
Can we at least hide this code behind a check for QTreeView, and even "isAnimated()" ?

broulik updated this revision to Diff 17624.Aug 3 2017, 1:01 PM
  • Explicitly check for QTreeView
  • Only if QTreeView::isAnimated()
This revision is now accepted and ready to land.Aug 3 2017, 1:03 PM

PS: same fix should probably go to oxygen :)

broulik added a comment.EditedAug 3 2017, 1:04 PM

PS: same fix should probably go to oxygen :)

Oxygen always paints a frame around side panels, no? Also, given it has a *gradient* background, you probably cannot avoid this as Qt just paints a solid color :/

PS: same fix should probably go to oxygen :)

Oxygen always paints a frame around side panels, no? Also, given it has a *gradient* background, you probably cannot avoid this as Qt just paints a solid color :/

yes you're right. Forget about it :)

This revision was automatically updated to reflect the committed changes.