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:
parent
d53ccc3b00
commit
c4399a67cb
@ -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();
|
||||
}
|
||||
|
@ -98,7 +98,6 @@ public:
|
||||
HoverState = 1,
|
||||
PressedState = 2,
|
||||
ManualPressedState = 4,
|
||||
MovedState = 8
|
||||
};
|
||||
Q_DECLARE_FLAGS(IconStates, IconState)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user