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:
parent
dc4981ec41
commit
ac040130bf
@ -968,6 +968,8 @@ void Icon::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
d->states |= Private::MovedState;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
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 (!handled) {
|
||||||
if (boundingRect().contains(event->pos())) {
|
if (boundingRect().contains(event->pos())) {
|
||||||
emit clicked();
|
emit clicked();
|
||||||
|
@ -97,7 +97,8 @@ public:
|
|||||||
NoState = 0,
|
NoState = 0,
|
||||||
HoverState = 1,
|
HoverState = 1,
|
||||||
PressedState = 2,
|
PressedState = 2,
|
||||||
ManualPressedState = 4
|
ManualPressedState = 4,
|
||||||
|
MovedState = 8
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(IconStates, IconState)
|
Q_DECLARE_FLAGS(IconStates, IconState)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user