Commit 09e09a9c authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Breeze Style] Fix flickering during KPageTreeView animation

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
this can be quite noticeable (e.g. Honeycomb).

Differential Revision:
parent e827fa08
......@@ -56,6 +56,7 @@
#include <QToolBar>
#include <QToolBox>
#include <QToolButton>
#include <QTreeView>
#include <QWidgetAction>
namespace BreezePrivate
......@@ -398,6 +399,17 @@ namespace Breeze
scrollArea->viewport()->setForegroundRole( QPalette::WindowText );
// QTreeView animates expanding/collapsing branches. It paints them into a
// temp pixmap whose background is unconditionally filled with the palette's
// *base* color which is usually different from the window's color
// cf. QTreeViewPrivate::renderTreeToPixmapForAnimation()
if ( QTreeView *treeView = qobject_cast<QTreeView *>( scrollArea ) ) {
if (treeView->isAnimated()) {
QPalette pal( treeView->palette() );
pal.setColor( QPalette::Active, QPalette::Base, treeView->palette().color( treeView->backgroundRole() ) );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment