From e7c34fb913b471aca96b97352adf0a49a388dcc4 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Sat, 29 Aug 2009 20:49:15 +0000 Subject: [PATCH] fixed button rendering using QPainterPath, as done for kde2 windeco svn path=/trunk/KDE/kdebase/workspace/; revision=1017180 --- clients/quartz/quartz.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/clients/quartz/quartz.cpp b/clients/quartz/quartz.cpp index 3f9aa5c539..4eb4085573 100644 --- a/clients/quartz/quartz.cpp +++ b/clients/quartz/quartz.cpp @@ -512,10 +512,18 @@ void QuartzButton::drawButton(QPainter *p) { int xOff = (width()-10)/2; int yOff = (height()-10)/2; - p->setPen( Qt::black ); - p->drawPixmap(isDown() ? xOff+2: xOff+1, isDown() ? yOff+2 : yOff+1, *deco); - p->setPen( KDecoration::options()->color(KDecoration::ColorButtonBg, decoration()->isActive()).light(150) ); - p->drawPixmap(isDown() ? xOff+1: xOff, isDown() ? yOff+1 : yOff, *deco); + QPainterPath path; + path.addRegion( *deco ); + + p->setPen( Qt::NoPen ); + p->setBrush( Qt::black ); + p->translate( isDown() ? QPoint( xOff+2, yOff+2 ) : QPoint( xOff+1, yOff+1 ) ); + p->drawPath( path ); + + p->setBrush( KDecoration::options()->color(KDecoration::ColorButtonBg, decoration()->isActive()).light(150) ); + p->translate( QPoint( -1, -1 ) ); + p->drawPath( path ); + } else { QPixmap btnpix;