fixed button rendering using QPainterPath, as done for kde2 windeco
svn path=/trunk/KDE/kdebase/workspace/; revision=1017171
This commit is contained in:
parent
0f9de2a3a8
commit
313bc152f2
1 changed files with 10 additions and 4 deletions
|
@ -338,10 +338,16 @@ void LaptopButton::drawButton(QPainter *p)
|
|||
p->drawLine(0, h-1, w-1, h-1);
|
||||
}
|
||||
|
||||
p->setPen(btnForeground);
|
||||
int xOff = (width()-8)/2;
|
||||
int yOff = (height()-8)/2;
|
||||
p->drawPixmap(isDown() ? xOff+1: xOff, isDown() ? yOff+1 : yOff, deco);
|
||||
QPainterPath path;
|
||||
path.addRegion( deco );
|
||||
|
||||
QPoint offset( (width()-8)/2, (height()-8)/2 );
|
||||
if( isDown() ) offset += QPoint( 1, 1 );
|
||||
p->translate( offset );
|
||||
p->setPen( Qt::NoPen );
|
||||
p->setBrush( btnForeground );
|
||||
p->drawPath( path );
|
||||
|
||||
}
|
||||
|
||||
// =====================================
|
||||
|
|
Loading…
Reference in a new issue