icons moving doesn't trigger a click action
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=760630
This commit is contained in:
parent
c4399a67cb
commit
6329570f8f
@ -963,6 +963,7 @@ void Icon::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
d->states |= Private::PressedState;
|
d->states |= Private::PressedState;
|
||||||
|
d->clickStartPos = scenePos();
|
||||||
|
|
||||||
bool handled = false;
|
bool handled = false;
|
||||||
foreach (IconAction *action, d->cornerActions) {
|
foreach (IconAction *action, d->cornerActions) {
|
||||||
@ -1016,6 +1017,8 @@ void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handled = d->clickStartPos != scenePos();
|
||||||
|
|
||||||
if (!handled) {
|
if (!handled) {
|
||||||
if (boundingRect().contains(event->pos())) {
|
if (boundingRect().contains(event->pos())) {
|
||||||
emit clicked();
|
emit clicked();
|
||||||
|
@ -174,6 +174,7 @@ public:
|
|||||||
bool invertLayout;
|
bool invertLayout;
|
||||||
bool drawBg;
|
bool drawBg;
|
||||||
QSizeF currentSize;
|
QSizeF currentSize;
|
||||||
|
QPointF clickStartPos;
|
||||||
|
|
||||||
QList<IconAction*> cornerActions;
|
QList<IconAction*> cornerActions;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user