Use widget bg pixmap if it exists. You can see a small screenshot of how
system looks now (53K) at http://www2.jorsm.com/~mosfet/system2.png. Not as cool IMHO, but clearer. svn path=/trunk/kdebase/kwin/; revision=34692
This commit is contained in:
parent
c101518499
commit
b1e3a4f9bb
2 changed files with 27 additions and 10 deletions
|
@ -125,4 +125,5 @@ static unsigned char pinup_mask_bits[] = {
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -41,19 +41,26 @@ static void create_pixmaps()
|
||||||
|
|
||||||
// titlebar
|
// titlebar
|
||||||
QPainter p;
|
QPainter p;
|
||||||
|
QPainter maskPainter;
|
||||||
int i, y;
|
int i, y;
|
||||||
titlePix = new QPixmap(32, 17);
|
titlePix = new QPixmap(32, 17);
|
||||||
|
QBitmap mask(32, 17);
|
||||||
|
mask.fill(Qt::color0);
|
||||||
|
|
||||||
p.begin(titlePix);
|
p.begin(titlePix);
|
||||||
p.fillRect(0, 0, 32, 17,
|
maskPainter.begin(&mask);
|
||||||
QBrush(options->color(Options::Frame, true),
|
maskPainter.setPen(Qt::color1);
|
||||||
QBrush::SolidPattern));
|
|
||||||
for(i=0, y=4; i < 4; ++i, y+=3){
|
for(i=0, y=4; i < 4; ++i, y+=3){
|
||||||
p.setPen(options->color(Options::TitleBar, true).light(150));
|
p.setPen(options->color(Options::TitleBar, true).light(150));
|
||||||
p.drawLine(0, y, 31, y);
|
p.drawLine(0, y, 31, y);
|
||||||
|
maskPainter.drawLine(0, y, 31, y);
|
||||||
p.setPen(options->color(Options::TitleBar, true).dark(120));
|
p.setPen(options->color(Options::TitleBar, true).dark(120));
|
||||||
p.drawLine(0, y+1, 31, y+1);
|
p.drawLine(0, y+1, 31, y+1);
|
||||||
|
maskPainter.drawLine(0, y+1, 31, y+1);
|
||||||
}
|
}
|
||||||
p.end();
|
p.end();
|
||||||
|
maskPainter.end();
|
||||||
|
titlePix->setMask(mask);
|
||||||
|
|
||||||
// Bottom frame gradient
|
// Bottom frame gradient
|
||||||
aFramePix = new KPixmap();
|
aFramePix = new KPixmap();
|
||||||
|
@ -249,18 +256,27 @@ void SystemClient::paintEvent( QPaintEvent* )
|
||||||
p.drawRect(rect());
|
p.drawRect(rect());
|
||||||
QRect t = titlebar->geometry();
|
QRect t = titlebar->geometry();
|
||||||
t.setTop( 1 );
|
t.setTop( 1 );
|
||||||
qDrawShadePanel(&p, rect().x()+1, rect().y()+1, rect().width()-2,
|
|
||||||
rect().height()-2,
|
// if we have a pixmapped bg use that, otherwise use color settings
|
||||||
options->colorGroup(Options::Frame, isActive()), false, 1,
|
if(colorGroup().brush(QColorGroup::Background).pixmap())
|
||||||
&options->colorGroup(Options::Frame, isActive()).
|
qDrawShadePanel(&p, rect().x()+1, rect().y()+1, rect().width()-2,
|
||||||
brush(QColorGroup::Button));
|
rect().height()-2, colorGroup(), false, 1,
|
||||||
|
&colorGroup().brush(QColorGroup::Background));
|
||||||
|
else
|
||||||
|
qDrawShadePanel(&p, rect().x()+1, rect().y()+1, rect().width()-2,
|
||||||
|
rect().height()-2,
|
||||||
|
options->colorGroup(Options::Frame, isActive()), false, 1,
|
||||||
|
&options->colorGroup(Options::Frame, isActive()).
|
||||||
|
brush(QColorGroup::Button));
|
||||||
t.setTop( 2 );
|
t.setTop( 2 );
|
||||||
if(isActive())
|
if(isActive())
|
||||||
p.drawTiledPixmap(t, *titlePix);
|
p.drawTiledPixmap(t, *titlePix);
|
||||||
|
else if(colorGroup().brush(QColorGroup::Background).pixmap())
|
||||||
|
p.fillRect(t, colorGroup().brush(QColorGroup::Background));
|
||||||
else
|
else
|
||||||
p.fillRect(t, options->colorGroup(Options::Frame, false).
|
p.fillRect(t, options->colorGroup(Options::Frame, false).
|
||||||
brush(QColorGroup::Button));
|
brush(QColorGroup::Button));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QRegion r = rect();
|
QRegion r = rect();
|
||||||
|
|
Loading…
Reference in a new issue