update the hover pos to make the entry point the last hovered location
BUG:172075 svn path=/trunk/KDE/kdelibs/; revision=882611
This commit is contained in:
parent
76d9ad90d4
commit
4e964a2ec8
@ -1080,7 +1080,12 @@ bool Containment::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
|
|||||||
//kDebug() << "got hoverenterEvent" << immutability() << " " << applet->immutability();
|
//kDebug() << "got hoverenterEvent" << immutability() << " " << applet->immutability();
|
||||||
if (immutability() == Mutable && applet->immutability() == Mutable) {
|
if (immutability() == Mutable && applet->immutability() == Mutable) {
|
||||||
QGraphicsSceneHoverEvent *he = static_cast<QGraphicsSceneHoverEvent*>(event);
|
QGraphicsSceneHoverEvent *he = static_cast<QGraphicsSceneHoverEvent*>(event);
|
||||||
if (!d->handles.contains(applet)) {
|
if (d->handles.contains(applet)) {
|
||||||
|
AppletHandle *handle = d->handles.value(applet);
|
||||||
|
if (handle) {
|
||||||
|
handle->setHoverPos(he->pos());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
//kDebug() << "generated applet handle";
|
//kDebug() << "generated applet handle";
|
||||||
AppletHandle *handle = new AppletHandle(this, applet, he->pos());
|
AppletHandle *handle = new AppletHandle(this, applet, he->pos());
|
||||||
d->handles[applet] = handle;
|
d->handles[applet] = handle;
|
||||||
|
@ -926,6 +926,11 @@ void AppletHandle::appletResized()
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AppletHandle::setHoverPos(const QPointF &hoverPos)
|
||||||
|
{
|
||||||
|
m_entryPos = hoverPos;
|
||||||
|
}
|
||||||
|
|
||||||
void AppletHandle::startFading(FadeType anim, const QPointF &hoverPos)
|
void AppletHandle::startFading(FadeType anim, const QPointF &hoverPos)
|
||||||
{
|
{
|
||||||
if (m_animId != 0) {
|
if (m_animId != 0) {
|
||||||
|
@ -64,6 +64,7 @@ class AppletHandle : public QObject, public QGraphicsItem
|
|||||||
QPainterPath shape() const;
|
QPainterPath shape() const;
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
||||||
void startFading(FadeType anim, const QPointF &hoverPos);
|
void startFading(FadeType anim, const QPointF &hoverPos);
|
||||||
|
void setHoverPos(const QPointF &hoverPos);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user