Simplified drawB2Rect()
svn path=/trunk/KDE/kdebase/kwin/; revision=417752
This commit is contained in:
parent
98b4a1f9b0
commit
96e70b86f8
1 changed files with 6 additions and 8 deletions
|
@ -146,11 +146,9 @@ static void drawB2Rect(KPixmap *pix, const QColor &primary, bool down)
|
||||||
QColor hColor = primary.light(150);
|
QColor hColor = primary.light(150);
|
||||||
QColor lColor = primary.dark(150);
|
QColor lColor = primary.dark(150);
|
||||||
|
|
||||||
|
if (down) qSwap(hColor, lColor);
|
||||||
|
|
||||||
if (QPixmap::defaultDepth() > 8) {
|
if (QPixmap::defaultDepth() > 8) {
|
||||||
if (down)
|
|
||||||
KPixmapEffect::gradient(*pix, lColor, hColor,
|
|
||||||
KPixmapEffect::DiagonalGradient);
|
|
||||||
else
|
|
||||||
KPixmapEffect::gradient(*pix, hColor, lColor,
|
KPixmapEffect::gradient(*pix, hColor, lColor,
|
||||||
KPixmapEffect::DiagonalGradient);
|
KPixmapEffect::DiagonalGradient);
|
||||||
}
|
}
|
||||||
|
@ -158,12 +156,12 @@ static void drawB2Rect(KPixmap *pix, const QColor &primary, bool down)
|
||||||
pix->fill(primary);
|
pix->fill(primary);
|
||||||
int x2 = pix->width() - 1;
|
int x2 = pix->width() - 1;
|
||||||
int y2 = pix->height() - 1;
|
int y2 = pix->height() - 1;
|
||||||
p.setPen(down ? hColor : lColor);
|
p.setPen(lColor);
|
||||||
p.drawLine(0, 0, x2, 0);
|
p.drawLine(0, 0, x2, 0);
|
||||||
p.drawLine(0, 0, 0, y2);
|
p.drawLine(0, 0, 0, y2);
|
||||||
p.drawLine(1, x2 - 1, x2 - 1, y2 - 1);
|
p.drawLine(1, x2 - 1, x2 - 1, y2 - 1);
|
||||||
p.drawLine(x2 - 1, 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);
|
p.drawRect(1, 1, x2, y2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue