From 4a55be45488025807875e2e37d55bd840ecc874c Mon Sep 17 00:00:00 2001 From: Rik Hemsley Date: Sun, 1 Oct 2000 14:48:40 +0000 Subject: [PATCH] I like this method of setting colours for the resize bar better, seeing as there's no way to set it via kcontrol svn path=/trunk/kdebase/kwin/; revision=65989 --- clients/riscos/Static.cpp | 84 ++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/clients/riscos/Static.cpp b/clients/riscos/Static.cpp index 57941d5b99..c507a6a5fd 100644 --- a/clients/riscos/Static.cpp +++ b/clients/riscos/Static.cpp @@ -216,6 +216,8 @@ Static::update() // ------------------------------------------------------------------------- Palette aBut, iBut; + QPixmap aTexture; + QPixmap iTexture; if (QPixmap::defaultDepth() > 8) { @@ -225,47 +227,45 @@ Static::update() setPalette(aTitlePal_, options->color(Options::TitleBar, true)); setPalette(iTitlePal_, options->color(Options::TitleBar, false)); - setPalette(aResizePal_, options->color(Options::Handle, true)); - setPalette(iResizePal_, options->color(Options::Handle, false)); + setPalette(aResizePal_, options->color(Options::TitleBar, true)); + setPalette(iResizePal_, options->color(Options::TitleBar, false)); + + QRgb light, dark; + QRgb * data; + QRgb w = qRgb(255,255,255); + QRgb b = qRgb(0,0,0); + + QPixmap tx = QPixmap((const char **)texture_xpm); + QImage aTx(tx.convertToImage()); + QImage iTx(aTx.copy()); + + light = options->color(Options::TitleBar, true).light(110).rgb(); + dark = options->color(Options::TitleBar, true).dark(110).rgb(); + + data = (QRgb *)aTx.bits(); + + for (int x = 0; x < 64*12; x++) + if (data[x] == w) + data[x] = light; + else if (data[x] == b) + data[x] = dark; + + light = options->color(Options::TitleBar, false).light(110).rgb(); + dark = options->color(Options::TitleBar, false).dark(110).rgb(); + + data = (QRgb *)iTx.bits(); + + for (int x = 0; x < 64*12; x++) + if (data[x] == w) + data[x] = light; + else if (data[x] == b) + data[x] = dark; + + + aTexture.convertFromImage(aTx); + iTexture.convertFromImage(iTx); } - QRgb light, dark; - QRgb * data; - QRgb w = qRgb(255,255,255); - QRgb b = qRgb(0,0,0); - - QPixmap tx = QPixmap((const char **)texture_xpm); - QImage aTx(tx.convertToImage()); - QImage iTx(aTx.copy()); - - light = options->color(Options::TitleBar, true).light(110).rgb(); - dark = options->color(Options::TitleBar, true).dark(110).rgb(); - - data = (QRgb *)aTx.bits(); - - for (int x = 0; x < 64*12; x++) - if (data[x] == w) - data[x] = light; - else if (data[x] == b) - data[x] = dark; - - light = options->color(Options::TitleBar, false).light(110).rgb(); - dark = options->color(Options::TitleBar, false).dark(110).rgb(); - - data = (QRgb *)iTx.bits(); - - for (int x = 0; x < 64*12; x++) - if (data[x] == w) - data[x] = light; - else if (data[x] == b) - data[x] = dark; - - - QPixmap aTexture; - aTexture.convertFromImage(aTx); - QPixmap iTexture; - iTexture.convertFromImage(iTx); - // ------------------------------------------------------------------------- // Bevels // ------------------------------------------------------------------------- @@ -337,7 +337,8 @@ Static::update() painter_.begin(&aTitleTextMid_); painter_.drawPixmap(0, 1, temp, 2, 0); - painter_.drawPixmap(0, 4, aTexture); + if (QPixmap::defaultDepth() > 8) + painter_.drawPixmap(0, 4, aTexture); painter_.end(); palette_ = iTitlePal_; @@ -345,7 +346,8 @@ Static::update() painter_.begin(&iTitleTextMid_); painter_.drawPixmap(0, 1, temp, 2, 0); - painter_.drawPixmap(0, 4, iTexture); + if (QPixmap::defaultDepth() > 8) + painter_.drawPixmap(0, 4, iTexture); painter_.end(); transy = 1.0;