From 5fceccc02d967d4d10b66d4c6d5a649fa2af96d4 Mon Sep 17 00:00:00 2001 From: "Daniel M. Duley" Date: Fri, 28 Apr 2000 02:59:07 +0000 Subject: [PATCH] Make it run on lowcolor displays svn path=/trunk/kdebase/kwin/; revision=47703 --- clients/system/systemclient.cpp | 36 ++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/clients/system/systemclient.cpp b/clients/system/systemclient.cpp index af14a6d693..09cba6fa67 100644 --- a/clients/system/systemclient.cpp +++ b/clients/system/systemclient.cpp @@ -206,11 +206,37 @@ void SystemButton::setBitmap(const unsigned char *bitmap) void SystemButton::drawButton(QPainter *p) { - if(client->isActive()) - p->drawPixmap(0, 0, isDown() ? *btnPixDown : *btnPix); - else - p->drawPixmap(0, 0, isDown() ? *iBtnPixDown : *iBtnPix); - + if(btnPixDown){ + if(client->isActive()) + p->drawPixmap(0, 0, isDown() ? *btnPixDown : *btnPix); + else + p->drawPixmap(0, 0, isDown() ? *iBtnPixDown : *iBtnPix); + } + else{ + QColorGroup g = options->colorGroup(Options::ButtonBg, + client->isActive()); + p->fillRect(0, 0, width(), height(), g.background()); + int x2 = width()-1; + int y2 = height()-1; + // outer frame + p->setPen(g.mid()); + p->drawLine(0, 0, x2, 0); + p->drawLine(0, 0, 0, y2); + p->setPen(g.light()); + p->drawLine(x2, 0, x2, y2); + p->drawLine(0, x2, y2, x2); + p->setPen(g.dark()); + p->drawRect(1, 1, width()-2, height()-2); + // inner frame + p->setPen(isDown() ? g.mid() : g.light()); + p->drawLine(2, 2, x2-2, 2); + p->drawLine(2, 2, 2, y2-2); + p->setPen(isDown() ? g.light() : g.mid()); + p->drawLine(x2-2, 2, x2-2, y2-2); + p->drawLine(2, x2-2, y2-2, x2-2); + + } + if(!deco.isNull()){ p->setPen(btnForeground); p->drawPixmap(isDown() ? 4 : 3, isDown() ? 4 : 3, deco);