From 0ec3c6bf5a559aee2b4f60ee1ab12bd13ee8160b Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Sun, 6 Jun 2010 18:12:21 +0000 Subject: [PATCH] use helper class to render resize handle dots, for consistency with the style. svn path=/trunk/KDE/kdebase/workspace/; revision=1135179 --- clients/oxygen/oxygenclient.cpp | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index 97d7cb9578..4885fd8a6e 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -47,12 +47,6 @@ namespace Oxygen { - //___________________________________________ - void renderDot(QPainter *p, const QPointF &point, qreal diameter) - { - p->drawEllipse(QRectF(point.x()-diameter/2, point.y()-diameter/2, diameter, diameter)); - } - //_________________________________________________________ QColor reduceContrast(const QColor &c0, const QColor &c1, double t) { @@ -1120,14 +1114,14 @@ namespace Oxygen { // Draw right side 3-dots resize handles - qreal cenY = h / 2 + y + 0.5; - qreal posX = w + x - 2.5; + //qreal cenY = h / 2 + y + 0.5; + //qreal posX = w + x - 2.5; + qreal cenY = h / 2 + y ; + qreal posX = w + x - 3; - painter->setPen(Qt::NoPen); - painter->setBrush( color ); - renderDot( painter, QPointF(posX, cenY - 3), 1.8); - renderDot( painter, QPointF(posX, cenY), 1.8); - renderDot( painter, QPointF(posX, cenY + 3), 1.8); + helper().renderDot( painter, QPointF(posX, cenY - 3), color); + helper().renderDot( painter, QPointF(posX, cenY), color); + helper().renderDot( painter, QPointF(posX, cenY + 3), color); } @@ -1135,14 +1129,11 @@ namespace Oxygen if( isResizable() && !isShade() && !configuration().drawSizeGrip() ) { - painter->setPen(Qt::NoPen); - painter->setBrush( color ); - painter->save(); painter->translate(x + w-9, y + h-9); - renderDot( painter, QPointF(2.5, 6.5), 1.8); - renderDot( painter, QPointF(5.5, 5.5), 1.8); - renderDot( painter, QPointF(6.5, 2.5), 1.8); + helper().renderDot( painter, QPointF(2, 6), color); + helper().renderDot( painter, QPointF(5, 5), color); + helper().renderDot( painter, QPointF(6, 2), color); painter->restore(); } @@ -1437,7 +1428,7 @@ namespace Oxygen renderFloatFrame( &painter, frame, palette ); // resize handles - renderDots( &painter, frame, QColor(0, 0, 0, 66) ); + renderDots( &painter, frame, backgroundColor( widget(), palette ) ); painter.restore(); }