--- a/src/hbcore/gui/hbmenuitem_p.cpp Fri Sep 17 08:32:10 2010 +0300
+++ b/src/hbcore/gui/hbmenuitem_p.cpp Mon Oct 04 00:38:12 2010 +0300
@@ -270,28 +270,27 @@
#ifdef HB_GESTURE_FW
void HbMenuItem::gestureEvent(QGestureEvent *event)
{
- //Q_D(HbMenuItem);
if(HbTapGesture *gesture = qobject_cast<HbTapGesture *>(event->gesture(Qt::TapGesture))) {
if (gesture->state() == Qt::GestureStarted) {
- if (scene())
+ if (scene()) {
scene()->setProperty(HbPrivate::OverridingGesture.latin1(),Qt::TapGesture);
+ }
gesture->setProperty(HbPrivate::ThresholdRect.latin1(), mapRectToScene(boundingRect()).toRect());
-
- // Tactile feedback
HbWidgetFeedback::triggered(this, Hb::InstantPressed);
-
pressStateChanged(true);
event->accept();
} else if (gesture->state() == Qt::GestureFinished) {
- if (scene())
+ if (scene()) {
scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant());
+ }
HbWidgetFeedback::triggered(this, Hb::InstantReleased);
pressStateChanged(false);
event->accept();
HbMenuPrivate::d_ptr(menu())->_q_triggerAction(this);
} else if (gesture->state() == Qt::GestureCanceled) {
- if (scene())
+ if (scene()) {
scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant());
+ }
pressStateChanged(false);
}
}
@@ -389,6 +388,10 @@
focusItem->setGeometry(boundingRect());
}
} else if (d->mFocusItem){
+ // hide() is required below in case there is a gesture
+ // cancellation going on. Without hide() the highlight is not
+ // removed.
+ d->mFocusItem->hide();
delete d->mFocusItem;
d->mFocusItem = 0;
}