--- a/src/hbwidgets/sliders/hbslidercontrol.cpp Tue Jul 06 14:36:53 2010 +0300
+++ b/src/hbwidgets/sliders/hbslidercontrol.cpp Wed Aug 18 10:05:37 2010 +0300
@@ -29,6 +29,7 @@
#include "hbsliderhandle_p.h"
#include "hbstyleoptionslider_p.h"
#include "hbslidertickmarkslabel_p.h"
+#include "hbstyle_p.h"
#include <hbstyle.h>
#include <hbinstance.h>
#include <hbtheme.h>
@@ -147,8 +148,8 @@
QGraphicsItem *HbSliderControlPrivate::createGroove()
{
Q_Q( HbSliderControl );
- QGraphicsItem *groove = qgraphicsitem_cast<QGraphicsItem*>( q->style( )->createPrimitive(
- HbStyle::P_Slider_groove, q ) );
+ QGraphicsItem *groove = qgraphicsitem_cast<QGraphicsItem*>( HbStylePrivate::createPrimitive(
+ HbStylePrivate::P_Slider_groove, q ) );
return groove;
}
/*!
@@ -158,8 +159,8 @@
QGraphicsItem *HbSliderControlPrivate::createProgressGroove()
{
Q_Q( HbSliderControl );
- QGraphicsItem *proggroove = qgraphicsitem_cast<QGraphicsItem*>( q->style( )->createPrimitive(
- HbStyle::P_Slider_progressgroove, q ) );//comes on top of groove
+ QGraphicsItem *proggroove = qgraphicsitem_cast<QGraphicsItem*>( HbStylePrivate::createPrimitive(
+ HbStylePrivate::P_Slider_progressgroove, q ) );//comes on top of groove
return proggroove;
}
@@ -201,7 +202,7 @@
handle->forceSetPos( rect.topLeft( ) );
//progress groove should be adjusted whenever handle position is changed
if ( progressGroove ) {
- q->style( )->updatePrimitive( progressGroove, HbStyle::P_Slider_progressgroove, &opt );
+ HbStylePrivate::updatePrimitive( progressGroove, HbStylePrivate::P_Slider_progressgroove, &opt );
}
}
@@ -597,7 +598,7 @@
{
Q_D( HbSliderControl );
if ( isSliderDown( ) && d->displayCurrValueToolTip ) {
- HbToolTip::showText( toolTip( ) , d->handle->primitive(HbStyle::P_SliderElement_touchhandle) , d->toolTipAlignment );
+ HbToolTip::showText( toolTip( ) , d->handle->primitive((HbStyle::Primitive)HbStylePrivate::P_SliderElement_touchhandle) , d->toolTipAlignment );
}
}
@@ -681,7 +682,7 @@
int pressValue = QStyle::sliderValueFromPosition( opt.minimum, opt.maximum,
static_cast<int>( handlePos ),static_cast<int>( span ),opt.upsideDown );
//update the groove and touch item
- style( )->updatePrimitive( d->groove, HbStyle::P_Slider_groove, &opt );
+ HbStylePrivate::updatePrimitive( d->groove, HbStylePrivate::P_Slider_groove, &opt );
// if default is set then do not increment or decrement slider value
// just set default value to slider
if ( d->setDefault ) {
@@ -742,7 +743,7 @@
d->groovePressed = false;
initStyleOption( &opt );
// update primitive from press to normal
- style( )->updatePrimitive( d->groove, HbStyle::P_Slider_groove, &opt );
+ HbStylePrivate::updatePrimitive( d->groove, HbStylePrivate::P_Slider_groove, &opt );
}
if ( event->buttons( ) ) {
event->ignore( );
@@ -816,7 +817,7 @@
HbStyleOptionSlider opt;
d->groovePressed = true;
initStyleOption( &opt );
- style( )->updatePrimitive( d->groove, HbStyle::P_Slider_groove, &opt );
+ HbStylePrivate::updatePrimitive( d->groove, HbStylePrivate::P_Slider_groove, &opt );
HbWidgetFeedback::triggered( this, Hb::InstantPressed );
}
break;
@@ -871,7 +872,7 @@
d->groovePressed = false;
initStyleOption( &opt );
// update primitive from press to normal
- style( )->updatePrimitive( d->groove, HbStyle::P_Slider_groove, &opt );
+ HbStylePrivate::updatePrimitive( d->groove, HbStylePrivate::P_Slider_groove, &opt );
}
}
break;
@@ -891,7 +892,7 @@
d->groovePressed = false;
initStyleOption( &opt );
// update primitive from press to normal
- style( )->updatePrimitive( d->groove, HbStyle::P_Slider_groove, &opt );
+ HbStylePrivate::updatePrimitive( d->groove, HbStylePrivate::P_Slider_groove, &opt );
}
}
break;
@@ -943,8 +944,7 @@
HbStyleOptionSlider opt;
d->groovePressed = true;
initStyleOption( &opt );
- style( )->updatePrimitive( d->groove, HbStyle::P_Slider_groove, &opt );
- HbWidgetFeedback::triggered( this, Hb::InstantPressed );
+ HbStylePrivate::updatePrimitive( d->groove, HbStylePrivate::P_Slider_groove, &opt );
event->ignore();
break;
} else {
@@ -969,6 +969,7 @@
int pressValue = sliderPosition();
setRepeatAction( SliderNoAction,static_cast<int>( pressValue ) );
event->ignore();
+ HbWidgetFeedback::triggered(this, Hb::InstantReleased);
HbAbstractSliderControl::gestureEvent(event);
}
break;
@@ -1184,11 +1185,11 @@
{
Q_D( const HbSliderControl );
switch( primitive ){
- case HbStyle::P_Slider_groove:
+ case HbStylePrivate::P_Slider_groove:
return ( d->groove );
- case HbStyle::P_Slider_thumb:
+ case HbStylePrivate::P_Slider_thumb:
return ( d->handle );
- case HbStyle::P_Slider_progressgroove:
+ case HbStylePrivate::P_Slider_progressgroove:
return ( d->progressGroove );
default:return( NULL );
}
@@ -1257,11 +1258,11 @@
opt.state &= ~QStyle::State_Enabled;
}
if ( d->groove ) {
- style( )->updatePrimitive( d->groove, HbStyle::P_Slider_groove, &opt );
+ HbStylePrivate::updatePrimitive( d->groove, HbStylePrivate::P_Slider_groove, &opt );
}
if( d->progressGroove ) {
- style( )->updatePrimitive( d->progressGroove, HbStyle::P_Slider_progressgroove, &opt );
+ HbStylePrivate::updatePrimitive( d->progressGroove, HbStylePrivate::P_Slider_progressgroove, &opt );
}
}
@@ -1322,8 +1323,8 @@
}
if ( enable ) {
//creating groove touch area
- d->grooveTouchArea = qgraphicsitem_cast<QGraphicsItem*>( style( )->createPrimitive(
- HbStyle::P_SliderElement_touchgroove, this ) );
+ d->grooveTouchArea = qgraphicsitem_cast<QGraphicsItem*>( HbStylePrivate::createPrimitive(
+ HbStylePrivate::P_SliderElement_touchgroove, this ) );
if ( d->grooveTouchArea ) {
HbStyle::setItemName( d->grooveTouchArea, "groovetoucharea" );
}