Have the icon applet explicitly tell the icon widget that a clicked() signal

isn't wanted after a mouse move rather than the widget assuming so. This means
that icon applets that can't be dragged act like regular buttons again.

Ok to commit this to 4.0 as well?

BUG: 155531

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=760441
This commit is contained in:
Jason Stubbs 2008-01-12 17:07:19 +00:00
parent d53ccc3b00
commit c4399a67cb
2 changed files with 2 additions and 8 deletions

View File

@ -997,8 +997,6 @@ void Icon::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
update();
}
}
d->states |= Private::MovedState;
}
void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
@ -1018,11 +1016,6 @@ void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
}
if (d->states & Private::MovedState) {
d->states &= ~Private::MovedState;
handled = true;
}
if (!handled) {
if (boundingRect().contains(event->pos())) {
emit clicked();
@ -1074,8 +1067,10 @@ void Icon::setPressed(bool pressed)
{
if (pressed) {
d->states |= Private::ManualPressedState;
d->states |= Private::PressedState;
} else {
d->states &= ~Private::ManualPressedState;
d->states &= ~Private::PressedState;
}
update();
}

View File

@ -98,7 +98,6 @@ public:
HoverState = 1,
PressedState = 2,
ManualPressedState = 4,
MovedState = 8
};
Q_DECLARE_FLAGS(IconStates, IconState)