Fix buttons, patch by Knut Johansson <knutmj@online.no>.

svn path=/trunk/KDE/kdebase/workspace/; revision=913425
This commit is contained in:
Luboš Luňák 2009-01-19 11:40:45 +00:00
parent 50ebf9e099
commit 42beacc8f1

View file

@ -116,20 +116,20 @@ static inline const KDecorationOptions *options()
static void drawButtonFrame( QPixmap *pix, const QPalette &g, bool sunken )
{
QPainter p;
int x2 = pix->width() - 1;
int y2 = pix->height() - 1;
int x2 = pix->width() - 3;
int y2 = pix->height() - 3;
p.begin(pix);
// titlebar button frame
p.setPen( sunken ? g.color(QPalette::Dark).dark(155) : g.color(QPalette::Light));
p.drawLine(0, 0, x2-1, 0);
p.drawLine(0, 0, 0, y2-1);
p.drawLine(0, 0, x2, 0);
p.drawLine(0, 0, 0, y2);
if (sunken)
{
p.setPen( g.color(QPalette::Mid).dark(135) );
p.drawLine(1, 1, x2-2, 1);
p.drawLine(1, 1, 1, y2-2);
p.drawLine(1, 1, x2-1, 1);
p.drawLine(1, 1, 1, y2-1);
}
p.setPen( sunken ? g.color(QPalette::Light) : g.color(QPalette::Mid).dark(135));