AppletHandle is no more parent of Applet, removing an unuseful piece of code that could cause problems
svn path=/trunk/KDE/kdelibs/; revision=1155655
This commit is contained in:
parent
a38bbc2e3a
commit
698d924ded
15
applet.cpp
15
applet.cpp
@ -1731,11 +1731,6 @@ bool Applet::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
|
|||||||
void Applet::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
void Applet::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (immutability() == Mutable && formFactor() == Plasma::Planar && (flags() & ItemIsMovable)) {
|
if (immutability() == Mutable && formFactor() == Plasma::Planar && (flags() & ItemIsMovable)) {
|
||||||
QGraphicsItem *parent = parentItem();
|
|
||||||
Plasma::Applet *applet = qgraphicsitem_cast<Plasma::Applet*>(parent);
|
|
||||||
|
|
||||||
if (applet && applet->isContainment()) {
|
|
||||||
// our direct parent is a containment. just move ourselves.
|
|
||||||
QPointF curPos = event->pos();
|
QPointF curPos = event->pos();
|
||||||
QPointF lastPos = event->lastPos();
|
QPointF lastPos = event->lastPos();
|
||||||
|
|
||||||
@ -1745,16 +1740,6 @@ void Applet::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
QPointF delta = t.map(curPos - lastPos);
|
QPointF delta = t.map(curPos - lastPos);
|
||||||
|
|
||||||
moveBy(delta.x(), delta.y());
|
moveBy(delta.x(), delta.y());
|
||||||
} else if (parent) {
|
|
||||||
//don't move the icon as well because our parent
|
|
||||||
//(usually an appletHandle) will do it for us
|
|
||||||
//parent->moveBy(delta.x(),delta.y());
|
|
||||||
QPointF curPos = parent->transform().map(event->pos());
|
|
||||||
QPointF lastPos = parent->transform().map(event->lastPos());
|
|
||||||
QPointF delta = curPos - lastPos;
|
|
||||||
|
|
||||||
parent->setPos(parent->pos() + delta);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user