diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -56,6 +56,7 @@ #include #include #include +#include #include namespace BreezePrivate @@ -398,6 +399,17 @@ 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( scrollArea ) ) { + if (treeView->isAnimated()) { + QPalette pal( treeView->palette() ); + pal.setColor( QPalette::Active, QPalette::Base, treeView->palette().color( treeView->backgroundRole() ) ); + treeView->setPalette(pal); + } + } } }