Index: kstyle/breezehelper.cpp =================================================================== --- kstyle/breezehelper.cpp +++ kstyle/breezehelper.cpp @@ -534,7 +534,7 @@ if( !outline.isValid() ) return; // adjust rect - QRectF frameRect( rect.adjusted( 1, 1, -1, -1 ) ); + QRectF frameRect( rect ); frameRect.adjust( 0.5, 0.5, -0.5, -0.5 ); // setup painter @@ -546,22 +546,18 @@ { default: case SideLeft: - frameRect.adjust( 0, 1, 0, -1 ); painter->drawLine( frameRect.topRight(), frameRect.bottomRight() ); break; case SideTop: - frameRect.adjust( 1, 0, -1, 0 ); painter->drawLine( frameRect.topLeft(), frameRect.topRight() ); break; case SideRight: - frameRect.adjust( 0, 1, 0, -1 ); painter->drawLine( frameRect.topLeft(), frameRect.bottomLeft() ); break; case SideBottom: - frameRect.adjust( 1, 0, -1, 0 ); painter->drawLine( frameRect.bottomLeft(), frameRect.bottomRight() ); break; Index: kstyle/breezestyle.h =================================================================== --- kstyle/breezestyle.h +++ kstyle/breezestyle.h @@ -198,6 +198,7 @@ QRect progressBarGrooveRect( const QStyleOption*, const QWidget* ) const; QRect progressBarContentsRect( const QStyleOption*, const QWidget* ) const; QRect progressBarLabelRect( const QStyleOption*, const QWidget* ) const; + QRect frameContentsRect( const QStyleOption*, const QWidget* ) const; QRect headerArrowRect( const QStyleOption*, const QWidget* ) const; QRect headerLabelRect( const QStyleOption*, const QWidget* ) const; QRect tabBarTabLeftButtonRect( const QStyleOption*, const QWidget* ) const; Index: kstyle/breezestyle.cpp =================================================================== --- kstyle/breezestyle.cpp +++ kstyle/breezestyle.cpp @@ -403,32 +403,6 @@ auto font( scrollArea->font() ); font.setBold( false ); scrollArea->setFont( font ); - - // adjust background role - if( !StyleConfigData::sidePanelDrawFrame() ) - { - scrollArea->setBackgroundRole( QPalette::Window ); - scrollArea->setForegroundRole( QPalette::WindowText ); - - if( scrollArea->viewport() ) - { - scrollArea->viewport()->setBackgroundRole( QPalette::Window ); - 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 ( auto 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); - } - } - } - } // disable autofill background for flat (== NoFrame) scrollareas, with QPalette::Window as a background @@ -450,6 +424,22 @@ { child->setAutoFillBackground( false ); } } + /* + 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( auto 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); + } + } + } //_______________________________________________________________ @@ -723,6 +713,7 @@ case SE_ProgressBarGroove: return progressBarGrooveRect( option, widget ); case SE_ProgressBarContents: return progressBarContentsRect( option, widget ); case SE_ProgressBarLabel: return progressBarLabelRect( option, widget ); + case SE_FrameContents: return frameContentsRect( option, widget ); case SE_HeaderArrow: return headerArrowRect( option, widget ); case SE_HeaderLabel: return headerLabelRect( option, widget ); case SE_TabBarTabLeftButton: return tabBarTabLeftButtonRect( option, widget ); @@ -1601,6 +1592,25 @@ } + //___________________________________________________________________________________________________________________ + QRect Style::frameContentsRect( const QStyleOption* option, const QWidget* widget ) const + { + if( !StyleConfigData::sidePanelDrawFrame() && + qobject_cast( widget ) && + widget->property( PropertyNames::sidePanelView ).toBool() ) + { + + // adjust margins for sidepanel widgets + return option->rect.adjusted( 0, 0, -1, 0 ); + + } else { + + // base class implementation + return ParentStyleClass::subElementRect( SE_FrameContents, option, widget ); + + } + } + //___________________________________________________________________________________________________________________ QRect Style::progressBarLabelRect( const QStyleOption* option, const QWidget* ) const {