Fixed bug #46966 using the first of the suggested methods.

The second part of the bug report does not seem to apply to any other
decoration in CVS.

Removed redundant copies of MouseEvents, since I were at it.

svn path=/trunk/kdebase/kwin/; revision=255165
This commit is contained in:
Luciano Montanaro 2003-09-30 18:13:18 +00:00
parent 9226142471
commit ba06d6afbf

View file

@ -171,7 +171,7 @@ void B2Button::drawButton(QPainter *p)
} }
else{ else{
if(client->isActive()){ if(client->isActive()){
if(isOn() || isDown()) if (isDown())
p->drawPixmap((width()-pDown->width())/2, p->drawPixmap((width()-pDown->width())/2,
(height()-pDown->height())/2, *pDown); (height()-pDown->height())/2, *pDown);
else else
@ -179,7 +179,7 @@ void B2Button::drawButton(QPainter *p)
(height()-pNorm->height())/2, *pNorm); (height()-pNorm->height())/2, *pNorm);
} }
else{ else{
if(isOn() || isDown()) if (isDown())
p->drawPixmap((width()-pDown->width())/2, p->drawPixmap((width()-pDown->width())/2,
(height()-pDown->height())/2, *iDown); (height()-pDown->height())/2, *iDown);
else else
@ -209,16 +209,12 @@ void B2Button::setPixmaps(int button_id)
void B2Button::mousePressEvent( QMouseEvent* e ) void B2Button::mousePressEvent( QMouseEvent* e )
{ {
last_button = e->button(); last_button = e->button();
QMouseEvent me ( e->type(), e->pos(), e->globalPos(), QButton::mousePressEvent(e);
LeftButton, e->state() );
QButton::mousePressEvent(&me);
} }
void B2Button::mouseReleaseEvent( QMouseEvent* e ) void B2Button::mouseReleaseEvent( QMouseEvent* e )
{ {
QMouseEvent me ( e->type(), e->pos(), e->globalPos(), QButton::mouseReleaseEvent(e);
LeftButton, e->state() );
QButton::mouseReleaseEvent(&me);
} }
// ===================================== // =====================================
@ -775,7 +771,7 @@ void B2Client::titleMoveRel(int xdiff)
void B2Client::desktopChange() void B2Client::desktopChange()
{ {
bool on = isOnAllDesktops(); bool on = isOnAllDesktops();
if (B2Button * b = button[BtnSticky]) { if (B2Button *b = button[BtnSticky]) {
b->setDown(on); b->setDown(on);
QToolTip::remove(b); QToolTip::remove(b);
QToolTip::add(b, on ? i18n("Not On All Desktops") : i18n("On All Desktops")); QToolTip::add(b, on ? i18n("Not On All Desktops") : i18n("On All Desktops"));