From 3922d1994a174a8cab3b1aa6c60d363840e6134d Mon Sep 17 00:00:00 2001 From: "Daniel M. Duley" Date: Tue, 25 Apr 2000 22:44:25 +0000 Subject: [PATCH] Reverting the no-flicker when moving titlebar patch. It doesn't repaint properly, the whole thing needs an overhaul (I never anticipated the thing being movable) and I want to use it now ;-) svn path=/trunk/kdebase/kwin/; revision=47542 --- clients/b2/b2client.cpp | 27 ++++++++++----------------- clients/b2/b2client.h | 2 +- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/clients/b2/b2client.cpp b/clients/b2/b2client.cpp index d9daae7c76..555650cb1e 100644 --- a/clients/b2/b2client.cpp +++ b/clients/b2/b2client.cpp @@ -282,15 +282,11 @@ B2Client::B2Client( Workspace *ws, WId w, QWidget *parent, else button[BtnMax]->setPixmaps(iMaxPix, iMaxPixDown); } -// QColor c = options->colorGroup(Options::TitleBar, isActive()). -// color(QColorGroup::Button); - QColor c = options->colorGroup(Options::TitleBar, true). + QColor c = options->colorGroup(Options::TitleBar, isActive()). color(QColorGroup::Button); for(i=0; i < 6; ++i) button[i]->setBg(c); - - setBackgroundColor(c); - + positionButtons(); connect(button[BtnMenu], SIGNAL(clicked()), this, SLOT(menuButtonPressed())); connect(button[BtnSticky], SIGNAL(clicked()), this, SLOT(toggleSticky())); @@ -323,14 +319,13 @@ void B2Client::captionChange( const QString &) { positionButtons(); doShape(); - repaint(false); + repaint(); } void B2Client::paintEvent( QPaintEvent* ) { - QPixmap pm(size()); - QPainter p; - p.begin( &pm, this ); + + QPainter p( this ); QRect t = g->cellGeometry(0, 1); t.setRight(button[BtnClose]->x()+17); @@ -387,8 +382,6 @@ void B2Client::paintEvent( QPaintEvent* ) button[BtnSticky]->x()+17); t.setRight(button[BtnIconify]->x()-1); p.drawText(t, AlignLeft | AlignVCenter, caption()); - p.end(); - bitBlt(this, 0, 0, &pm); } #define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) @@ -421,7 +414,7 @@ void B2Client::showEvent(QShowEvent *ev) { Client::showEvent(ev); doShape(); - repaint(false); + repaint(); } void B2Client::windowWrapperShowEvent( QShowEvent* ) @@ -511,7 +504,7 @@ void B2Client::mouseMoveEvent( QMouseEvent * e) if (bar_x_ofs != old_ofs) { positionButtons(); doShape(); - repaint( 0, 0, width(), t.height(), false ); + repaint( 0, 0, width(), t.height(), true ); } } } else @@ -537,7 +530,7 @@ void B2Client::maximizeChange(bool m) else button[BtnMax]->setPixmaps(iMaxPix, iMaxPixDown); } - button[BtnMax]->repaint(false); + button[BtnMax]->repaint(); } @@ -570,7 +563,7 @@ void B2Client::activeChange(bool on) color(QColorGroup::Button); for(i=0; i < 6; ++i){ button[i]->setBg(c); - button[i]->repaint(false); + button[i]->repaint(); } Client::activeChange(on); } @@ -597,7 +590,7 @@ void B2Client::slotReset() button[i]->setBg(c); button[i]->repaint(false); } - repaint(false); + repaint(); } static void redraw_pixmaps() diff --git a/clients/b2/b2client.h b/clients/b2/b2client.h index 5c3919c6e7..23f167b69d 100644 --- a/clients/b2/b2client.h +++ b/clients/b2/b2client.h @@ -16,7 +16,7 @@ public: B2Button(QWidget *parent=0, const char *name=0) : QButton(parent, name){useMiniIcon = false;} B2Button(KPixmap *pix, KPixmap *pixDown, QWidget *parent=0, const char *name=0); - void setBg(const QColor &c){bg = c; setBackgroundColor(c);} + void setBg(const QColor &c){bg = c;} void setPixmaps(KPixmap *pix, KPixmap *pixDown); void setToggle(){setToggleType(Toggle);} void setActive(bool on){setOn(on);}