Enable dragging of icons by clicking in the middle of the IconApplet.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=756862
This commit is contained in:
Christopher Blauvelt 2008-01-03 21:10:07 +00:00
parent dc4981ec41
commit ac040130bf
2 changed files with 9 additions and 1 deletions

View File

@ -968,6 +968,8 @@ void Icon::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
update();
}
}
d->states |= Private::MovedState;
}
void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
@ -987,6 +989,11 @@ 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();

View File

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