src/hbwidgets/sliders/hbprogressslider.cpp
changeset 28 b7da29130b0e
parent 23 e6ad4ef83b23
equal deleted inserted replaced
23:e6ad4ef83b23 28:b7da29130b0e
    69         return;
    69         return;
    70     }
    70     }
    71     if (value >= mMaximum) {
    71     if (value >= mMaximum) {
    72         value = mMaximum;
    72         value = mMaximum;
    73 #ifdef HB_EFFECTS
    73 #ifdef HB_EFFECTS
    74        // HbEffect::start(mTrack, HB_PRGRESSSLIDER_ITEM_TYPE, "progressbar_progress_complete");
    74         HbEffect::start(mTrack, HB_PRGRESSSLIDER_ITEM_TYPE, "progressbar_progress_complete");
    75 #endif
    75 #endif
    76     }
    76     }
    77     else if (value < mMinimum) {
    77     else if (value < mMinimum) {
    78         value = mMinimum;
    78         value = mMinimum;
    79     }
    79     }
   137             HbStylePrivate::updatePrimitive(mFrame, HbStylePrivate::P_ProgressSlider_frame, &option);          
   137             HbStylePrivate::updatePrimitive(mFrame, HbStylePrivate::P_ProgressSlider_frame, &option);          
   138         }
   138         }
   139         HbWidgetFeedback::triggered(q, Hb::InstantReleased);
   139         HbWidgetFeedback::triggered(q, Hb::InstantReleased);
   140 
   140 
   141 #ifdef HB_EFFECTS
   141 #ifdef HB_EFFECTS
   142        // HbEffect::start(q, HB_PRGRESSSLIDER_ITEM_TYPE, "progressslider_trackrelease");
   142         HbEffect::start(q, HB_PRGRESSSLIDER_ITEM_TYPE, "progressslider_trackrelease");
   143 #endif
   143 #endif
   144     }
   144     }
   145 
   145 
   146     emit q->sliderReleased();
   146     emit q->sliderReleased();
   147 }
   147 }
   156 }
   156 }
   157 
   157 
   158 QRectF HbProgressSliderPrivate::boundingRect()const
   158 QRectF HbProgressSliderPrivate::boundingRect()const
   159 {
   159 {
   160     return mFrame->boundingRect();
   160     return mFrame->boundingRect();
   161 }
       
   162 
       
   163 HbStyle* HbProgressSliderPrivate::style() const
       
   164 {
       
   165      Q_Q(const HbProgressSlider);
       
   166      return q->style();
       
   167 }
   161 }
   168 
   162 
   169 QGraphicsItem* HbProgressSliderPrivate::parentGraphicsItem() const
   163 QGraphicsItem* HbProgressSliderPrivate::parentGraphicsItem() const
   170 {
   164 {
   171     return mFrame;
   165     return mFrame;
   311 */
   305 */
   312 
   306 
   313 HbProgressSlider::HbProgressSlider(QGraphicsItem *parent) :
   307 HbProgressSlider::HbProgressSlider(QGraphicsItem *parent) :
   314     HbProgressBar(*new HbProgressSliderPrivate,parent)
   308     HbProgressBar(*new HbProgressSliderPrivate,parent)
   315 {
   309 {
   316     HbEffect::disable(this);
       
   317     Q_D( HbProgressSlider );
   310     Q_D( HbProgressSlider );
   318     d->q_ptr = this;
   311     d->q_ptr = this;
   319     d->init();
   312     d->init();
   320     setMinMaxTextVisible(true);
   313     setMinMaxTextVisible(true);
   321 
   314 
   332 
   325 
   333     }
   326     }
   334     else{
   327     else{
   335         d->handle->setPos(0,boundingRect().height());
   328         d->handle->setPos(0,boundingRect().height());
   336     }
   329     }
   337 
       
   338     HbEffect::disable(this);
       
   339 }
   330 }
   340 
   331 
   341 
   332 
   342 /*!
   333 /*!
   343     @beta
   334     @beta
   345     \param parent The parent of ProgressBar
   336     \param parent The parent of ProgressBar
   346 */
   337 */
   347 HbProgressSlider::HbProgressSlider(HbProgressSliderPrivate &dd,QGraphicsItem *parent) : 
   338 HbProgressSlider::HbProgressSlider(HbProgressSliderPrivate &dd,QGraphicsItem *parent) : 
   348     HbProgressBar( dd,parent)
   339     HbProgressBar( dd,parent)
   349 {
   340 {
   350     HbEffect::disable(this);
   341 
   351     Q_D( HbProgressSlider );
   342     Q_D( HbProgressSlider );
   352     d->init();
   343     d->init();
   353 
   344 
   354     setFocusPolicy(Qt::FocusPolicy(qApp->style()->styleHint(QStyle::SH_Button_FocusPolicy)));
   345     setFocusPolicy(Qt::FocusPolicy(qApp->style()->styleHint(QStyle::SH_Button_FocusPolicy)));
   355     d->handle =new HbProgressSliderHandle(d);
   346     d->handle =new HbProgressSliderHandle(d);
   359         d->handle->setPos(0,posY);
   350         d->handle->setPos(0,posY);
   360     }
   351     }
   361     else{
   352     else{
   362         d->handle->setPos(0,boundingRect().height());
   353         d->handle->setPos(0,boundingRect().height());
   363     }
   354     }
   364 
       
   365     HbEffect::disable(this);
       
   366 }
   355 }
   367 
   356 
   368 
   357 
   369 /*!
   358 /*!
   370     @beta
   359     @beta