hand hover events more responsibly in containment and applethandle; another patch by ambro
(abro: one more solid patch like this and i'll be hitting you up to get an svn account of your own ;) BUG:167551 svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=838889
This commit is contained in:
parent
e4a154743f
commit
42018972e6
@ -742,7 +742,6 @@ bool AppletHandle::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
|
||||
{
|
||||
if (watched == m_applet && event->type() == QEvent::GraphicsSceneHoverLeave) {
|
||||
hoverLeaveEvent(static_cast<QGraphicsSceneHoverEvent*>(event));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -840,9 +840,7 @@ bool Containment::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
|
||||
//kDebug() << "got hoverenterEvent" << immutability() << " " << applet->immutability();
|
||||
if (immutability() == Mutable && applet->immutability() == Mutable) {
|
||||
QGraphicsSceneHoverEvent *he = static_cast<QGraphicsSceneHoverEvent*>(event);
|
||||
if (d->handles.contains(applet)) {
|
||||
d->handles[applet]->startFading(AppletHandle::FadeIn, he->pos());
|
||||
} else {
|
||||
if (!d->handles.contains(applet)) {
|
||||
//kDebug() << "generated applet handle";
|
||||
AppletHandle *handle = new AppletHandle(this, applet, he->pos());
|
||||
d->handles[applet] = handle;
|
||||
@ -853,14 +851,6 @@ bool Containment::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case QEvent::GraphicsSceneHoverLeave:
|
||||
//kDebug() << "got hoverLeaveEvent";
|
||||
if (d->handles.contains(applet)) {
|
||||
QGraphicsSceneHoverEvent *he = static_cast<QGraphicsSceneHoverEvent *>(event);
|
||||
if (!d->handles[applet]->boundingRect().contains(d->handles[applet]->mapFromScene(he->scenePos()))) {
|
||||
d->handles[applet]->startFading(AppletHandle::FadeOut, he->pos());
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user