From 9e709f278436c25e2e73d2fcab0238f0f18ae5d5 Mon Sep 17 00:00:00 2001 From: "Daniel M. Duley" Date: Mon, 27 Mar 2000 09:43:24 +0000 Subject: [PATCH] Frame for the titlebar. I originally left this out to leave more room for the text when using tiny titlebars but it looks like crap without it ;-) BTW, is this style working well for laptop people? svn path=/trunk/kdebase/kwin/; revision=44853 --- clients/laptop/laptopclient.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/clients/laptop/laptopclient.cpp b/clients/laptop/laptopclient.cpp index cc2ed55e46..a86eea01e7 100644 --- a/clients/laptop/laptopclient.cpp +++ b/clients/laptop/laptopclient.cpp @@ -204,8 +204,8 @@ LaptopClient::LaptopClient( Workspace *ws, WId w, QWidget *parent, KConfig *config = KGlobal::config(); config->setGroup("Laptop"); titleHeight = config->readNumEntry("TitleHeight", 14); - if(titleHeight < 14) - titleHeight = 14; + if(titleHeight < 15) + titleHeight = 15; if(titleHeight > 32) titleHeight = 32; } @@ -333,11 +333,7 @@ void LaptopClient::paintEvent( QPaintEvent* ) if(titlePix && isActive()) p.drawTiledPixmap(r.x(), r.y(), r.width(), r.height()-1, *titlePix); - if(grPix){ // needs to happen after the above - p.setPen(options->color(Options::TitleBar, isActive())); - p.drawRect(r.x(), r.y(), r.width(), r.height()-1); - } - + QButton *rBtn = providesContextHelp() ? button[4] : button[1]; int x2 = button[3]->x()+button[3]->width(); @@ -359,7 +355,6 @@ void LaptopClient::paintEvent( QPaintEvent* ) p.drawLine(x2, rBtn->y()-1, x2, rBtn->y()+h); p.drawLine(rBtn->x()-1, rBtn->y()+h, x2, rBtn->y()+h); - p.setPen(options->color(Options::Font, isActive())); p.setFont(options->font(isActive())); QFontMetrics fm(options->font(true)); g = options->colorGroup(Options::TitleBar, isActive()); @@ -370,9 +365,21 @@ void LaptopClient::paintEvent( QPaintEvent* ) *grPix); else p.fillRect(r.x()+((r.width()-fm.width(caption()))/2)-4, r.y(), - fm.width(caption())+8, r.height(), + fm.width(caption())+8, r.height()-1, g.brush(QColorGroup::Background)); } + /* + qDrawShadePanel(&p, r.x(), r.y(), r.width(), r.height()-1, + options->colorGroup(Options::TitleBar, isActive()), + true, 1); + */ + p.setPen(g.mid()); + p.drawLine(r.x(), r.y(), r.right(), r.y()); + p.drawLine(r.x(), r.y(), r.x(), r.bottom()-1); + p.setPen(g.button()); + p.drawLine(r.right(), r.y(), r.right(), r.bottom()-1); + p.drawLine(r.x(), r.bottom()-1, r.right(), r.bottom()-1); + p.setPen(options->color(Options::Font, isActive())); p.drawText(r.x(), r.y(), r.width(), r.height()-1, AlignCenter, caption() ); }