src/hbwidgets/itemviews/hbabstractviewitem.cpp
changeset 5 627c4a0fd0e7
parent 3 11d3954df52a
child 6 c3690ec91ef8
--- a/src/hbwidgets/itemviews/hbabstractviewitem.cpp	Thu May 27 13:10:59 2010 +0300
+++ b/src/hbwidgets/itemviews/hbabstractviewitem.cpp	Fri Jun 11 13:58:22 2010 +0300
@@ -230,13 +230,12 @@
             break;
         }
         case Qt::GestureFinished: {
-            HbWidgetFeedback::triggered(q, Hb::InstantReleased, 0);
-
             if (gesture->tapStyleHint() == HbTapGesture::Tap 
                 || (mSharedData->mItemView
                 && !mSharedData->mItemView->longPressEnabled())) {
                 setPressed(false, true);
 
+                HbWidgetFeedback::triggered(q, Hb::InstantReleased, 0);
                 HbWidgetFeedback::triggered(q, Hb::InstantClicked);
                 QPointer<HbAbstractViewItem> item = q;
                 emit item->activated(position);
@@ -249,13 +248,13 @@
                     }
                 }
             } else {
+                HbWidgetFeedback::triggered(q, Hb::InstantReleased,0);
                 emit q->released(position);
             }
 
             break;
         }
         case Qt::GestureCanceled: {
-
             // hides focus immediately
             setPressed(false, false);
 
@@ -286,7 +285,13 @@
         mPressed = pressed;
 
         if (mSharedData->mPressStateChangeTimer) {
-            mSharedData->mPressStateChangeTimer->stop();
+            if(!pressed && animate && mSharedData->mPressStateChangeTimer->isActive()) {
+                // Release happened while press still delayed
+                mSharedData->mPressStateChangeTimer->stop();
+                mSharedData->pressStateChangeTimerTriggered();
+            } else {
+                mSharedData->mPressStateChangeTimer->stop();
+            }
         }
 
         if (mPressed) {