From b9e1b4a325512e117915cb51620f31204600173a Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Mon, 22 Sep 2014 10:55:29 +0200 Subject: [PATCH] selection is always square. No rounded corners --- kstyle/breezehelper.cpp | 18 ++++-------------- kstyle/breezehelper.h | 2 +- kstyle/breezestyle.cpp | 26 +------------------------- 3 files changed, 6 insertions(+), 40 deletions(-) diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp index d1765e1e..e487bef0 100644 --- a/kstyle/breezehelper.cpp +++ b/kstyle/breezehelper.cpp @@ -615,23 +615,13 @@ namespace Breeze //______________________________________________________________________________ void Helper::renderSelection( QPainter* painter, const QRect& rect, - const QColor& color, Corners corners ) const + const QColor& color ) const { painter->setRenderHint( QPainter::Antialiasing ); - - const QRectF baseRect( rect ); - - if( color.isValid() ) - { - // content - const qreal radius( frameRadius() ); - const QRectF contentRect( baseRect ); - QPainterPath path( roundedPath( contentRect, corners, radius ) ); - painter->setPen( Qt::NoPen ); - painter->setBrush( color ); - painter->drawPath( path ); - } + painter->setPen( Qt::NoPen ); + painter->setBrush( color ); + painter->drawRect( rect ); } diff --git a/kstyle/breezehelper.h b/kstyle/breezehelper.h index 437c3c51..33b5261e 100644 --- a/kstyle/breezehelper.h +++ b/kstyle/breezehelper.h @@ -167,7 +167,7 @@ namespace Breeze void renderTabWidgetFrame( QPainter*, const QRect&, const QColor& color, const QColor& outline, Corners corners ) const; //* selection frame - void renderSelection( QPainter*, const QRect&, const QColor&, Corners ) const; + void renderSelection( QPainter*, const QRect&, const QColor& ) const; //* separator void renderSeparator( QPainter*, const QRect&, const QColor&, bool vertical = false ) const; diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index 2e2d1a42..f1120e39 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -3222,32 +3222,8 @@ namespace Breeze else color = color.lighter( 110 ); } - // get selection path - Corners corners; - const bool hasSingleSelection( abstractItemView && abstractItemView->selectionMode() == QAbstractItemView::SingleSelection ); - if( hasSingleSelection ) - { - - // round relevant corners - if( - viewItemOption->viewItemPosition == QStyleOptionViewItemV4::OnlyOne || - viewItemOption->viewItemPosition == QStyleOptionViewItemV4::Invalid || - ( abstractItemView && abstractItemView->selectionBehavior() != QAbstractItemView::SelectRows ) ) - { - - corners = AllCorners; - - } else { - - if( viewItemOption->viewItemPosition == QStyleOptionViewItemV4::Beginning ) corners |= CornersLeft; - if( viewItemOption->viewItemPosition == QStyleOptionViewItemV4::End ) corners |= CornersRight; - - } - - } - // render - _helper->renderSelection( painter, rect, color, corners ); + _helper->renderSelection( painter, rect, color ); return true; }