ganeswidgets/src/hgcoverflowcontainer.cpp
changeset 20 a60f8b6b1d32
parent 17 a10844a9914d
equal deleted inserted replaced
17:a10844a9914d 20:a60f8b6b1d32
    16 */
    16 */
    17 
    17 
    18 #include <QGesture>
    18 #include <QGesture>
    19 #include <QGraphicsSceneResizeEvent>
    19 #include <QGraphicsSceneResizeEvent>
    20 #include <QPainter>
    20 #include <QPainter>
       
    21 #include <HbWidgetFeedback>
    21 #include "hgcoverflowcontainer.h"
    22 #include "hgcoverflowcontainer.h"
    22 #include "hgmediawallrenderer.h"
    23 #include "hgmediawallrenderer.h"
    23 #include "hgwidgetitem.h"
    24 #include "hgwidgetitem.h"
    24 #include "hgcenteritemarea.h"
    25 #include "hgcenteritemarea.h"
    25 #include "trace.h"
    26 #include "trace.h"
   228     mRenderer->setFrontCoverElevationFactor(factor);
   229     mRenderer->setFrontCoverElevationFactor(factor);
   229 }
   230 }
   230 
   231 
   231 void HgCoverflowContainer::enableReflections(bool enabled)
   232 void HgCoverflowContainer::enableReflections(bool enabled)
   232 {
   233 {
       
   234     mReflectionsEnabled = enabled;
   233     if (mRenderer)
   235     if (mRenderer)
   234         mRenderer->enableReflections(enabled);
   236         mRenderer->enableReflections(enabled);
   235 }
   237 }
   236 
   238 
   237 bool HgCoverflowContainer::reflectionsEnabled() const
   239 bool HgCoverflowContainer::reflectionsEnabled() const
   238 {
   240 {
   239     return mRenderer ? mRenderer->reflectionsEnabled() : false;
   241     return mReflectionsEnabled;
   240 }
   242 }
   241 
   243 
   242 void HgCoverflowContainer::setCenterItemArea(HgCenterItemArea *centerItemArea)
   244 void HgCoverflowContainer::setCenterItemArea(HgCenterItemArea *centerItemArea)
   243 {
   245 {
   244     FUNC_LOG;
   246     FUNC_LOG;
   265         int hitItemIndex = -1;
   267         int hitItemIndex = -1;
   266         // hititem will be valid since hasItemAt returned true.
   268         // hititem will be valid since hasItemAt returned true.
   267         HgWidgetItem* hitItem = getItemAt(pos,hitItemIndex);
   269         HgWidgetItem* hitItem = getItemAt(pos,hitItemIndex);
   268         switch (state) 
   270         switch (state) 
   269             {
   271             {
       
   272             
   270             case Qt::GestureStarted:
   273             case Qt::GestureStarted:
   271                 {
   274                 {                                
   272                 mIgnoreGestureAction = false;
   275                 mIgnoreGestureAction = false;
   273                 
   276                 
   274                 if (mHandleLongPress && !mSpring.isActive()) {
   277                 if (mHandleLongPress && !mSpring.isActive()) {
   275                     // in coverflow mode we react to longtap only if animation is not on and
   278                     // in coverflow mode we react to longtap only if animation is not on and
   276                     // center item is tapped.
   279                     // center item is tapped.
   280                 }
   283                 }
   281                 mSpring.cancel();
   284                 mSpring.cancel();
   282                 break;
   285                 break;
   283                 }
   286                 }
   284             case Qt::GestureFinished:
   287             case Qt::GestureFinished:
       
   288                 {
       
   289                 // This enables tactile and audio feedback
       
   290                 HbWidgetFeedback::triggered(this, Hb::InstantPressed, 0);
   285                 handleGesture = handleTapAction(pos,hitItem,hitItemIndex);
   291                 handleGesture = handleTapAction(pos,hitItem,hitItemIndex);
       
   292                 }
   286             case Qt::GestureUpdated:
   293             case Qt::GestureUpdated:
   287             case Qt::GestureCanceled:
   294             case Qt::GestureCanceled:
   288             default:
   295             default:
   289                 stopLongPressWatcher();
   296                 stopLongPressWatcher();
   290                 break;
   297                 break;