Simplified drawB2Rect()

svn path=/trunk/KDE/kdebase/kwin/; revision=417752
This commit is contained in:
Luciano Montanaro 2005-05-24 13:54:37 +00:00
parent 98b4a1f9b0
commit 96e70b86f8

View file

@ -146,11 +146,9 @@ static void drawB2Rect(KPixmap *pix, const QColor &primary, bool down)
QColor hColor = primary.light(150);
QColor lColor = primary.dark(150);
if (down) qSwap(hColor, lColor);
if (QPixmap::defaultDepth() > 8) {
if (down)
KPixmapEffect::gradient(*pix, lColor, hColor,
KPixmapEffect::DiagonalGradient);
else
KPixmapEffect::gradient(*pix, hColor, lColor,
KPixmapEffect::DiagonalGradient);
}
@ -158,12 +156,12 @@ static void drawB2Rect(KPixmap *pix, const QColor &primary, bool down)
pix->fill(primary);
int x2 = pix->width() - 1;
int y2 = pix->height() - 1;
p.setPen(down ? hColor : lColor);
p.setPen(lColor);
p.drawLine(0, 0, x2, 0);
p.drawLine(0, 0, 0, y2);
p.drawLine(1, x2 - 1, x2 - 1, y2 - 1);
p.drawLine(x2 - 1, 1, x2 - 1, y2 - 1);
p.setPen(down ? lColor : hColor);
p.setPen(hColor);
p.drawRect(1, 1, x2, y2);
}