Operating under the premise that applets will receive notified with

constraintsUpdated(LocationConstraint) whenever there is a change in
position relative view makes global geometry handling much easier.
This change ensures that moving an applet via its handle follows the
above premise.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=746173
This commit is contained in:
Jason Stubbs 2007-12-08 03:38:11 +00:00
parent 10af4df668
commit 80bbadc39f
2 changed files with 9 additions and 0 deletions

View File

@ -335,6 +335,14 @@ void AppletHandle::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
}
}
QVariant AppletHandle::itemChange(GraphicsItemChange change, const QVariant &value)
{
if (change == ItemPositionHasChanged && m_applet) {
m_applet->constraintsUpdated(Plasma::LocationConstraint);
}
return QGraphicsItem::itemChange(change, value);
}
void AppletHandle::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
Q_UNUSED(event);

View File

@ -52,6 +52,7 @@ class AppletHandle : public QObject, public QGraphicsItem
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
Q_SIGNALS:
void disappearDone(AppletHandle *self);