Commit df134061 authored by Marco Martin's avatar Marco Martin
Browse files

show a thin separator between view and scrollbar

Summary:
This look makes listviews look way better, not having the selected
items look truncated into nothingness.
Always display "big" handles, due to the numerous complaints of the slim handles not being obvious

Test Plan:
Before:
{F7882628}
After:
{F7882624}

Reviewers: #plasma, #breeze, #vdg, ngraham, hpereiradacosta

Reviewed By: #vdg, ngraham, hpereiradacosta

Subscribers: ndavis, ahiemstra, hpereiradacosta, mthw, plasma-devel

Tags: #plasma

Maniphest Tasks: T9126

Differential Revision: https://phabricator.kde.org/D26655
parent 6694eb7a
......@@ -103,7 +103,7 @@ namespace Breeze
MenuBarItem_MarginHeight = 6,
// scrollbars
ScrollBar_Extend = 20,
ScrollBar_Extend = 21,
ScrollBar_SliderWidth = 6,
ScrollBar_MinSliderHeight = 20,
ScrollBar_NoButtonHeight = (ScrollBar_Extend-ScrollBar_SliderWidth)/2,
......
......@@ -1255,6 +1255,23 @@ namespace Breeze
}
//______________________________________________________________________________
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
{
......
......@@ -242,6 +242,9 @@ namespace Breeze
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;
......
......@@ -2324,11 +2324,16 @@ namespace Breeze
//___________________________________________________________________________________________________________________
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 )
{
......@@ -6557,6 +6562,17 @@ namespace Breeze
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 )
{
......
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