diff --git a/kstyle/breeze.h b/kstyle/breeze.h --- a/kstyle/breeze.h +++ b/kstyle/breeze.h @@ -103,7 +103,7 @@ MenuBarItem_MarginHeight = 6, // scrollbars - ScrollBar_Extend = 20, + ScrollBar_Extend = 21, ScrollBar_SliderWidth = 6, ScrollBar_MinSliderHeight = 20, ScrollBar_NoButtonHeight = (ScrollBar_Extend-ScrollBar_SliderWidth)/2, diff --git a/kstyle/breezehelper.h b/kstyle/breezehelper.h --- a/kstyle/breezehelper.h +++ b/kstyle/breezehelper.h @@ -242,6 +242,9 @@ void renderToolBarHandle( QPainter* painter, const QRect& rect, const QColor& color ) const { return renderProgressBarGroove( painter, rect, color ); } + //* separator between scrollbar and contents + void renderScrollBarBorder( QPainter*, const QRect&, const QColor& ) const; + //* tabbar tab void renderTabBarTab( QPainter*, const QRect&, const QColor& color, const QColor& outline, Corners ) const; diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp --- a/kstyle/breezehelper.cpp +++ b/kstyle/breezehelper.cpp @@ -1255,6 +1255,23 @@ } + + //______________________________________________________________________________ + void Helper::renderScrollBarBorder( + QPainter* painter, const QRect& rect, + const QColor& color ) const + { + + // content + if( color.isValid() ) + { + painter->setPen( Qt::NoPen ); + painter->setBrush( color ); + painter->drawRect( rect ); + } + + } + //______________________________________________________________________________ void Helper::renderTabBarTab( QPainter* painter, const QRect& rect, const QColor& color, const QColor& outline, Corners corners ) const { diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -2324,11 +2324,16 @@ //___________________________________________________________________________________________________________________ QRect Style::scrollBarInternalSubControlRect( const QStyleOptionComplex* option, SubControl subControl ) const { - - const auto& rect = option->rect; const State& state( option->state ); const bool horizontal( state & State_Horizontal ); + QRect rect = option->rect; + if (horizontal) { + rect.setTop(PenWidth::Frame); + } else { + rect.setLeft(PenWidth::Frame); + } + switch( subControl ) { @@ -6558,6 +6563,17 @@ if( opacity == AnimationData::OpacityInvalid ) opacity = 1; + QRect separatorRect; + if ( option->state & State_Horizontal ) { + separatorRect = QRect(0, 0, option->rect.width(), 1); + } else { + separatorRect = alignedRect(option->direction, + Qt::AlignLeft, + QSize(1, option->rect.height()), option->rect); + } + + _helper->renderScrollBarBorder( painter, separatorRect, _helper->alphaColor( option->palette.color( QPalette::WindowText ), 0.1 )); + // render full groove directly, rather than using the addPage and subPage control element methods if( (!StyleConfigData::animationsEnabled() || mouseOver || animated) && option->subControls & SC_ScrollBarGroove ) {