src/hbwidgets/sliders/hbprogresssliderhandle_p.cpp
changeset 23 e6ad4ef83b23
parent 21 4633027730f5
child 28 b7da29130b0e
equal deleted inserted replaced
21:4633027730f5 23:e6ad4ef83b23
    58 HbProgressSliderHandle::HbProgressSliderHandle(HbHandleParent *parent) 
    58 HbProgressSliderHandle::HbProgressSliderHandle(HbHandleParent *parent) 
    59     :HbWidget(parent->parentGraphicsItem()),
    59     :HbWidget(parent->parentGraphicsItem()),
    60     q(parent),
    60     q(parent),
    61     mHandleIcon()
    61     mHandleIcon()
    62 {
    62 {
       
    63     HbEffect::disable(this);
    63     mFlags = 0;
    64     mFlags = 0;
    64     mFlags |= TextVisible;
    65     mFlags |= TextVisible;
    65 
    66 
    66     mHandleIconItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_ProgressSliderHandle_icon,this);
    67     mHandleIconItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_ProgressSliderHandle_icon,this);
    67     HbStyle::setItemName(mHandleIconItem , "icon");
    68     HbStyle::setItemName(mHandleIconItem , "icon");
   100 
   101 
   101     HbStylePrivate::updatePrimitive(mHandleIconItem, HbStylePrivate::P_ProgressSliderHandle_icon, &option);
   102     HbStylePrivate::updatePrimitive(mHandleIconItem, HbStylePrivate::P_ProgressSliderHandle_icon, &option);
   102 }
   103 }
   103 
   104 
   104 
   105 
   105 void HbProgressSliderHandle::gestureEvent(QGestureEvent *event)
       
   106 {
       
   107     Q_UNUSED(event);
       
   108     // HbWidgetBase::gestureEvent() ignores, overriding to accept
       
   109 }
       
   110 
   106 
   111 void HbProgressSliderHandle::mousePressEvent(QGraphicsSceneMouseEvent *event) 
   107 void HbProgressSliderHandle::mousePressEvent(QGraphicsSceneMouseEvent *event) 
   112 {
   108 {
       
   109 #ifndef HB_GESTURE_FW
   113     HbWidget::mousePressEvent(event);
   110     HbWidget::mousePressEvent(event);
   114 
   111 
   115 #ifdef HB_EFFECTS
   112 #ifdef HB_EFFECTS
   116     HbEffect::start(this, HB_PRGRESSSLIDERHANDLE_ITEM_TYPE, "progressslider_handlepress");
   113     HbEffect::start(this, HB_PRGRESSSLIDERHANDLE_ITEM_TYPE, "progressslider_handlepress");
   117 #endif
   114 #endif
   142          HbExtendedLocale locale;
   139          HbExtendedLocale locale;
   143          HbProgressSlider *slider = (HbProgressSlider*)q->parentGraphicsWidget();
   140          HbProgressSlider *slider = (HbProgressSlider*)q->parentGraphicsWidget();
   144          HbToolTip::showText(locale.toString(slider->sliderValue()),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment());
   141          HbToolTip::showText(locale.toString(slider->sliderValue()),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment());
   145 
   142 
   146      }
   143      }
       
   144 #else
       
   145     Q_UNUSED(event)
       
   146 #endif 
   147 }
   147 }
   148 
   148 
   149 void HbProgressSliderHandle::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) 
   149 void HbProgressSliderHandle::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) 
   150 {
   150 {
       
   151 #ifndef HB_GESTURE_FW
   151     HbWidget::mouseReleaseEvent(event);
   152     HbWidget::mouseReleaseEvent(event);
   152 
   153 
   153     HbStyleOptionProgressSliderHandle option;
   154     HbStyleOptionProgressSliderHandle option;
   154     initStyleOption(&option);
   155     initStyleOption(&option);
   155     option.pressedState = false;
   156     option.pressedState = false;
   168     mFlags &= ~HbProgressSliderHandle::MousePressed;
   169     mFlags &= ~HbProgressSliderHandle::MousePressed;
   169     mFlags &=~HandleMoving;
   170     mFlags &=~HandleMoving;
   170     event->accept();
   171     event->accept();
   171     setHandlePosForValue(q->progressValue());   
   172     setHandlePosForValue(q->progressValue());   
   172     q->emitSliderReleased();
   173     q->emitSliderReleased();
   173 }
   174 #else
   174 
   175     Q_UNUSED(event)
   175 void HbProgressSliderHandle::handleTrackRelease(QGraphicsSceneMouseEvent * event)
   176 #endif 
   176 {
       
   177     Q_UNUSED(event);
       
   178     setHandlePosForValue(q->progressValue());   
       
   179 }
       
   180 
       
   181 void HbProgressSliderHandle::handleTrackPress(QGraphicsSceneMouseEvent * event)
       
   182 {
       
   183     QPointF newPos = q->parentGraphicsItem()->mapFromScene(event->scenePos());
       
   184     if((newPos.x() >=  q->boundingRect().x()) && (newPos.x() <=  q->boundingRect().width())) {   
       
   185         if(q->orientation() == Qt::Horizontal){
       
   186             mItemCurPos = QPointF(newPos.x() - boundingRect().width()/2, pos().y());
       
   187         }
       
   188         else{
       
   189             mItemCurPos = QPointF(pos().x(), newPos.y()-boundingRect().height()/2);
       
   190         }
       
   191 
       
   192         mItemCurPos = normalizedPos(mItemCurPos,false);
       
   193         setPos(mItemCurPos);
       
   194         processItemChange(mItemCurPos);
       
   195     }
       
   196 }
   177 }
   197 
   178 
   198 void HbProgressSliderHandle::mouseMoveEvent ( QGraphicsSceneMouseEvent * event ) 
   179 void HbProgressSliderHandle::mouseMoveEvent ( QGraphicsSceneMouseEvent * event ) 
   199 {
   180 {
       
   181 #ifndef HB_GESTURE_FW
   200     HbWidget::mouseMoveEvent(event);
   182     HbWidget::mouseMoveEvent(event);
   201     mFlags |=HandleMoving;
   183     mFlags |=HandleMoving;
   202     QPointF scenePos = event->scenePos();
   184     QPointF scenePos = event->scenePos();
   203     if(q->orientation() == Qt::Horizontal){
   185     if(q->orientation() == Qt::Horizontal){
   204              mItemCurPos = QPointF((event->scenePos().x() - mMousePressPos.x()) + mItemPosAtPress.x(), pos().y());
   186              mItemCurPos = QPointF((event->scenePos().x() - mMousePressPos.x()) + mItemPosAtPress.x(), pos().y());
   239          HbExtendedLocale locale;
   221          HbExtendedLocale locale;
   240          HbProgressSlider *slider = (HbProgressSlider*)q->parentGraphicsWidget();
   222          HbProgressSlider *slider = (HbProgressSlider*)q->parentGraphicsWidget();
   241          HbToolTip::showText(locale.toString(slider->sliderValue()),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment());
   223          HbToolTip::showText(locale.toString(slider->sliderValue()),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment());
   242 
   224 
   243      }
   225      }
       
   226 #else
       
   227     Q_UNUSED(event)
       
   228 #endif 
       
   229 }
       
   230 
       
   231 void HbProgressSliderHandle::handleTrackRelease(QGestureEvent *event)
       
   232 {
       
   233     Q_UNUSED(event);
       
   234     setHandlePosForValue(q->progressValue());   
       
   235 }
       
   236 
       
   237 void HbProgressSliderHandle::handleTrackPress(QGestureEvent *event)
       
   238 {
       
   239     HbTapGesture *gesture = static_cast<HbTapGesture *>(event->gesture(Qt::TapGesture));
       
   240     QPointF newPos = q->parentGraphicsItem()->mapFromScene(event->mapToGraphicsScene(gesture->position()));
       
   241 
       
   242     //QPointF newPos = q->parentGraphicsItem()->mapFromScene(event->scenePos());
       
   243     if((newPos.x() >=  q->boundingRect().x()) && (newPos.x() <=  q->boundingRect().width())) {   
       
   244         if(q->orientation() == Qt::Horizontal){
       
   245             mItemCurPos = QPointF(newPos.x() - boundingRect().width()/2, pos().y());
       
   246         }
       
   247         else{
       
   248             mItemCurPos = QPointF(pos().x(), newPos.y()-boundingRect().height()/2);
       
   249         }
       
   250 
       
   251         mItemCurPos = normalizedPos(mItemCurPos,false);
       
   252         setPos(mItemCurPos);
       
   253         processItemChange(mItemCurPos);
       
   254     }
       
   255 }
       
   256 
       
   257 
       
   258 /*!
       
   259   reimp
       
   260 
       
   261 */
       
   262 void HbProgressSliderHandle::gestureEvent(QGestureEvent *event)
       
   263 { 
       
   264     if(HbTapGesture *tap = qobject_cast<HbTapGesture *>(event->gesture(Qt::TapGesture))) {
       
   265         switch(tap->state()) {
       
   266             case Qt::GestureStarted: {
       
   267                 mMousePressPos = mapFromScene(event->mapToGraphicsScene(tap->position( )));                
       
   268                 if(q->textVisible()) {  // User called it 
       
   269                     if(!q->toolTipText().isNull()) {
       
   270                         HbToolTip::showText(q->toolTipText(),this, QRectF(mMousePressPos,QSize(0,0)),q->textAlignment());            
       
   271                     }        
       
   272                 }
       
   273                 else {  // show default
       
   274                     HbExtendedLocale locale;
       
   275                     HbProgressSlider *slider = (HbProgressSlider*)q->parentGraphicsWidget();
       
   276                     HbToolTip::showText(locale.toString(slider->sliderValue()),this, QRectF(mMousePressPos,QSize(0,0)),q->textAlignment());
       
   277                 }
       
   278                 #ifdef HB_EFFECTS
       
   279                     HbEffect::start(this, HB_PRGRESSSLIDERHANDLE_ITEM_TYPE, "progressslider_handlepress");
       
   280                 #endif
       
   281                 mFlags |= HbProgressSliderHandle::MousePressed;
       
   282                 HbStyleOptionProgressSliderHandle option;
       
   283                 initStyleOption(&option);
       
   284                 option.pressedState = true;
       
   285                 if (mHandleIconItem) {
       
   286                     HbStylePrivate::updatePrimitive(mHandleIconItem, HbStylePrivate::P_ProgressSliderHandle_icon, &option);
       
   287                 }
       
   288                 mMousePressPos = mapFromScene(event->mapToGraphicsScene(tap->position( )));
       
   289                 HbWidgetFeedback::triggered(q->parentGraphicsWidget(), Hb::InstantPressed, Hb::ModifierSliderHandle);
       
   290                 event->accept();
       
   291 
       
   292                 q->emitSliderPressed();  
       
   293             }
       
   294             break;
       
   295             case Qt::GestureFinished:{
       
   296                 HbStyleOptionProgressSliderHandle option;
       
   297                 initStyleOption(&option);
       
   298                 option.pressedState = false;
       
   299                 if (mHandleIconItem) {
       
   300                 HbStylePrivate::updatePrimitive(mHandleIconItem, HbStylePrivate::P_ProgressSliderHandle_icon, &option);
       
   301                 }
       
   302                 if (isHandleMoving()) {
       
   303                     HbWidgetFeedback::continuousStopped(q->parentGraphicsWidget(), Hb::ContinuousDragged);
       
   304                 }
       
   305                 HbWidgetFeedback::triggered(q->parentGraphicsWidget(), Hb::InstantReleased, Hb::ModifierSliderHandle);
       
   306                 #ifdef HB_EFFECTS
       
   307                 HbEffect::start(this, HB_PRGRESSSLIDERHANDLE_ITEM_TYPE, "progressslider_handlerelease");
       
   308                 #endif
       
   309                 mFlags &= ~HbProgressSliderHandle::MousePressed;
       
   310                 mFlags &=~HandleMoving;
       
   311                 event->accept();
       
   312                 setHandlePosForValue(q->progressValue());   
       
   313                 q->emitSliderReleased();
       
   314             }
       
   315             break;
       
   316             default:
       
   317                 break;                                  
       
   318         }
       
   319     }
       
   320     if (HbPanGesture *panGesture = qobject_cast<HbPanGesture*>(event->gesture(Qt::PanGesture))) {
       
   321         switch(panGesture->state( )) {
       
   322             case Qt::GestureStarted: 
       
   323             case Qt::GestureUpdated:{
       
   324                     mFlags |=HandleMoving;
       
   325                     QPointF scenePos =mapToParent( mapFromScene(panGesture->sceneOffset( )+panGesture->sceneStartPos( )));
       
   326                     if(scenePos.x() == oldCord.x()) {
       
   327                         return;
       
   328                     }
       
   329                     oldCord = scenePos;
       
   330                     //if(q->orientation() == Qt::Horizontal){
       
   331                         mItemCurPos = QPointF((scenePos.x() - mMousePressPos.x()), pos().y());
       
   332                         HbWidgetFeedback::continuousTriggered(qobject_cast<HbWidget*>(q->parentGraphicsWidget()), Hb::ContinuousDragged);
       
   333                         if(mItemCurPos.x()+boundingRect().width() < q->boundingRect().width() && mItemCurPos.x()>q->boundingRect().topLeft().x() ){
       
   334                         setPos(mItemCurPos);
       
   335                     //}
       
   336                     //else{
       
   337                     //    processItemChange(mItemCurPos);
       
   338                     //}
       
   339                 }
       
   340                 if (!mTouchItem->boundingRect().contains(parentItem()->mapFromScene(scenePos))) {
       
   341                     #ifdef HB_EFFECTS
       
   342                     HbEffect::start(this, HB_PRGRESSSLIDERHANDLE_ITEM_TYPE, "progressslider_handleoutofbound");
       
   343                     #endif
       
   344                 }
       
   345                 event->accept();
       
   346                 if(q->textVisible()) {  // User called it 
       
   347                      if(q->toolTipText().isNull()) {
       
   348                          // Dont show any tooltip.                     
       
   349                      }
       
   350                      else { 
       
   351                          HbToolTip::showText(q->toolTipText(),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment());                    
       
   352                      }        
       
   353                  }
       
   354                  else {  // show default
       
   355                      HbExtendedLocale locale;
       
   356                      HbProgressSlider *slider = (HbProgressSlider*)q->parentGraphicsWidget();
       
   357                      HbToolTip::showText(locale.toString(slider->sliderValue()),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment());
       
   358                  } 
       
   359                  q->emitSliderMoved(pointToValue(mItemCurPos));
       
   360             }
       
   361             break;
       
   362             case Qt::GestureFinished:
       
   363             case Qt::GestureCanceled: {
       
   364                 HbStyleOptionProgressSliderHandle option;
       
   365                 option.pressedState = false;
       
   366                 initStyleOption(&option);
       
   367                 if (mHandleIconItem) {
       
   368                     HbStylePrivate::updatePrimitive(mHandleIconItem, HbStylePrivate::P_ProgressSliderHandle_icon, &option);
       
   369                 }
       
   370                 if (isHandleMoving()) {
       
   371                   HbWidgetFeedback::continuousStopped(q->parentGraphicsWidget(), Hb::ContinuousDragged);
       
   372                 }
       
   373                 else {
       
   374                     HbWidgetFeedback::triggered(q->parentGraphicsWidget(), Hb::InstantReleased, Hb::ModifierSliderHandle);
       
   375                 }
       
   376                 #ifdef HB_EFFECTS
       
   377                 HbEffect::start(this, HB_PRGRESSSLIDERHANDLE_ITEM_TYPE, "progressslider_handlerelease");
       
   378                 #endif
       
   379                 mFlags &= ~HbProgressSliderHandle::MousePressed;
       
   380                 mFlags &=~HandleMoving;
       
   381                 event->accept();
       
   382                 setHandlePosForValue(q->progressValue());   
       
   383                 q->emitSliderReleased();
       
   384             }
       
   385             break;
       
   386             default:
       
   387                 break;
       
   388         }
       
   389     }
       
   390 
   244 }
   391 }
   245 
   392 
   246 int HbProgressSliderHandle::pointToValue(QPointF point) const
   393 int HbProgressSliderHandle::pointToValue(QPointF point) const
   247 {
   394 {
   248     QRectF rect = q->boundingRect();
   395     QRectF rect = q->boundingRect();
   249     qreal effectiveWidth;
   396     qreal effectiveWidth;
   250     point = normalizedPos(point,q->invertedAppearance());
   397     point = normalizedPos(point,q->invertedAppearance());
   251     qreal givenPixel;
   398     qreal givenPixel;
   252     if(q->orientation() == Qt::Horizontal){
   399  
   253         effectiveWidth = rect.width() - boundingRect().width();
   400     effectiveWidth = rect.width() - boundingRect().width();
   254         givenPixel = point.x();
   401     givenPixel = point.x();
   255     }
   402     
   256     else{
       
   257         effectiveWidth = rect.height() - boundingRect().height();
       
   258         givenPixel = effectiveWidth-point.y();
       
   259     }
       
   260 
       
   261     qreal tickPerPixel = (qreal)(q->maximum()-q->minimum())/effectiveWidth;
   403     qreal tickPerPixel = (qreal)(q->maximum()-q->minimum())/effectiveWidth;
   262     qreal tickForGivenPixel = givenPixel * tickPerPixel;
   404     qreal tickForGivenPixel = givenPixel * tickPerPixel;
   263     tickForGivenPixel = qRound(tickForGivenPixel);
   405     tickForGivenPixel = qRound(tickForGivenPixel);
   264 
   406 
   265     int value;
   407     int value;
   283 {
   425 {
   284     QRectF r1 = q->boundingRect();
   426     QRectF r1 = q->boundingRect();
   285     QRectF r2 = boundingRect();
   427     QRectF r2 = boundingRect();
   286 
   428 
   287     qreal width;
   429     qreal width;
   288     if(q->orientation()== Qt::Horizontal){
   430     width = r1.width() - r2.width();
   289         width = r1.width() - r2.width();
       
   290         
       
   291     }
       
   292     else{
       
   293         width = r1.height() - r2.height();
       
   294        
       
   295     }
       
   296     if(q->maximum() != q->minimum()){
   431     if(q->maximum() != q->minimum()){
   297         qreal pixelpertick = width/(qreal)(q->maximum()-q->minimum());
   432         qreal pixelpertick = width/(qreal)(q->maximum()-q->minimum());
   298         qreal noOfTicks = qreal(value - q->minimum());
   433         qreal noOfTicks = qreal(value - q->minimum());
   299         qreal xpos =  noOfTicks * pixelpertick;
   434         qreal xpos =  noOfTicks * pixelpertick;
   300         if(q->orientation() == Qt::Horizontal){
   435         return QPointF(xpos, r1.top());
   301             return QPointF(xpos, r1.top());
       
   302         }
       
   303         else{
       
   304             return QPointF(r1.left(),width-xpos);
       
   305         }
       
   306     }
   436     }
   307     else{
   437     else{
   308         return QPointF(0,0);
   438         return QPointF(0,0);
   309     }
   439     }
   310 }
   440 }
   311 
   441 
   312 QPointF HbProgressSliderHandle::normalizedPos(const QPointF&  pos,bool inverted) const 
   442 QPointF HbProgressSliderHandle::normalizedPos(const QPointF&  pos,bool inverted) const 
   313 {
   443 {
   314     Q_UNUSED(inverted);
   444     Q_UNUSED(inverted);
       
   445     
   315     QPointF newPos = pos;
   446     QPointF newPos = pos;
   316     if(q->orientation() == Qt::Horizontal){
   447     
   317         if (newPos.x() < HandleMargin) {
   448     if (newPos.x() < HandleMargin) {
   318             newPos.setX( HandleMargin );
   449             newPos.setX( HandleMargin );
   319         }
   450     }
   320 
   451 
   321         if (newPos.x() > q->boundingRect().width() - boundingRect().width() - HandleMargin) {
   452     if (newPos.x() > q->boundingRect().width() - boundingRect().width() - HandleMargin) {
   322             newPos.setX(q->boundingRect().width() - boundingRect().width() - HandleMargin);
   453             newPos.setX(q->boundingRect().width() - boundingRect().width() - HandleMargin);
   323         }
   454     }
   324     }
   455     
   325     else{
       
   326         if (newPos.y() < HandleMargin) {
       
   327             newPos.setY( HandleMargin );
       
   328         }
       
   329 
       
   330         if (newPos.y() > q->boundingRect().height() - boundingRect().height() - HandleMargin) {
       
   331             newPos.setY(q->boundingRect().height() - boundingRect().height() - HandleMargin);
       
   332         }
       
   333     }
       
   334     return newPos;
   456     return newPos;
   335 }
   457 }
   336 
   458 
   337 bool HbProgressSliderHandle::isHandlePressed() const
   459 bool HbProgressSliderHandle::isHandlePressed() const
   338 {
   460 {
   348 QVariant HbProgressSliderHandle::processItemChange(const QVariant &value)
   470 QVariant HbProgressSliderHandle::processItemChange(const QVariant &value)
   349 {
   471 {
   350         // value is the new position
   472         // value is the new position
   351         QPointF pt = value.toPointF();
   473         QPointF pt = value.toPointF();
   352         int newValue = pointToValue(pt);
   474         int newValue = pointToValue(pt);
   353         if(q->orientation() == Qt::Horizontal){
   475         pt.setY(q->boundingRect().top());
   354             pt.setY(q->boundingRect().top());
       
   355         }
       
   356         else{
       
   357             pt.setX(q->boundingRect().left());
       
   358         }
       
   359         q->emitSliderMoved(newValue);
   476         q->emitSliderMoved(newValue);
   360         QPointF newPos = pt;
   477         QPointF newPos = pt;
   361         return normalizedPos(newPos,false);
   478         return normalizedPos(newPos,false);
   362 }
   479 }
   363 
   480 
   366     if(!mFlags.testFlag(HbProgressSliderHandle::MousePressed)){
   483     if(!mFlags.testFlag(HbProgressSliderHandle::MousePressed)){
   367 
   484 
   368         QPointF newPos = valueToHandlePos(progressValue);
   485         QPointF newPos = valueToHandlePos(progressValue);
   369         QPointF pos = normalizedPos(newPos,q->invertedAppearance());
   486         QPointF pos = normalizedPos(newPos,q->invertedAppearance());
   370         if(q->invertedAppearance()) {
   487         if(q->invertedAppearance()) {
   371             if(q->orientation() == Qt::Horizontal){
       
   372                 qreal xVal = q->boundingRect().width() - pos.x() - boundingRect().width();
   488                 qreal xVal = q->boundingRect().width() - pos.x() - boundingRect().width();
   373                 pos.setX(xVal);
   489                 pos.setX(xVal);
   374             }
       
   375             else{
       
   376                 qreal yVal = q->boundingRect().height() - pos.y() - boundingRect().height();
       
   377                 pos.setY(yVal);
       
   378             }
       
   379            
       
   380         }
   490         }
   381 
       
   382         qreal yPos = qreal (q->boundingRect().height()-boundingRect().height()) /2 ;
   491         qreal yPos = qreal (q->boundingRect().height()-boundingRect().height()) /2 ;
   383         setPos(pos.x(),yPos);
   492         setPos(pos.x(),yPos);
   384     }   
   493     }    
   385    
       
   386 }
   494 }
   387 
   495 
   388 
   496 
   389 void  HbProgressSliderHandle::updatePrimitives()
   497 void  HbProgressSliderHandle::updatePrimitives()
   390 {    
   498 {    
   422 {
   530 {
   423     HbWidget::initStyleOption(option);
   531     HbWidget::initStyleOption(option);
   424     option->handleIcon = mHandleIcon;
   532     option->handleIcon = mHandleIcon;
   425     option->pressedState = false;
   533     option->pressedState = false;
   426 }
   534 }
   427 
   535 void HbProgressSliderHandle::setPressedState()
       
   536 {
       
   537    HbStyleOptionProgressSliderHandle option;
       
   538    initStyleOption(&option);
       
   539    option.pressedState = true;
       
   540    if (mHandleIconItem) {
       
   541          HbStylePrivate::updatePrimitive(mHandleIconItem, HbStylePrivate::P_ProgressSliderHandle_icon, &option);
       
   542    }
       
   543 }
       
   544 void HbProgressSliderHandle::setReleasedState()
       
   545 {
       
   546    HbStyleOptionProgressSliderHandle option;
       
   547    initStyleOption(&option);
       
   548    option.pressedState = false;
       
   549    if (mHandleIconItem) {
       
   550          HbStylePrivate::updatePrimitive(mHandleIconItem, HbStylePrivate::P_ProgressSliderHandle_icon, &option);
       
   551    }
       
   552 }
       
   553