From b51ce3fc34ecd42c3d486f171b3762f7f4e2b5ec Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Sat, 29 Aug 2009 20:38:43 +0000 Subject: [PATCH] fixed button rendering using QPainterPath, as done for kde2 windeco svn path=/trunk/KDE/kdebase/workspace/; revision=1017178 --- clients/modernsystem/modernsys.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clients/modernsystem/modernsys.cpp b/clients/modernsystem/modernsys.cpp index 4210b74c73..588a6b9a56 100644 --- a/clients/modernsystem/modernsys.cpp +++ b/clients/modernsystem/modernsys.cpp @@ -431,8 +431,12 @@ void ModernButton::drawButton(QPainter *p) p->drawPixmap(0, 0, isDown() ? *iButtonPixDown : *iButtonPix); } if(!deco.isNull()){ - p->setPen(*buttonFg); - p->drawPixmap(isDown() ? 4 : 3, isDown() ? 5 : 4, deco); + QPainterPath path; + path.addRegion( deco ); + p->setBrush(*buttonFg); + p->setPen( Qt::NoPen ); + p->translate( isDown() ? QPoint( 4, 5 ):QPoint( 3, 4 ) ); + p->drawPath( path ); } }