Hover events cause relayout to occur, and slider doesn't prevent relayout
if there is no size change. Modified Slider::DisplayValue to prevent text
label being set if there is no change to the current text.
Change-Id: Ib8651ff618f8b3452810d0d0bf1237803cdf1206
Signed-off-by: David Steele <david.steele@samsung.com>
void Slider::DisplayValue( float value, bool raiseSignals )
{
void Slider::DisplayValue( float value, bool raiseSignals )
{
- float clampledValue = Clamp( value, GetLowerBound(), GetUpperBound() );
+ float clampedValue = Clamp( value, GetLowerBound(), GetUpperBound() );
- float percent = MapValuePercentage( clampledValue );
+ float percent = MapValuePercentage( clampedValue );
float x = mDomain.from.x + percent * ( mDomain.to.x - mDomain.from.x );
float x = mDomain.from.x + percent * ( mDomain.to.x - mDomain.from.x );
if( raiseSignals )
{
Toolkit::Slider self = Toolkit::Slider::DownCast( Self() );
if( raiseSignals )
{
Toolkit::Slider self = Toolkit::Slider::DownCast( Self() );
- mValueChangedSignal.Emit( self, clampledValue );
+ mValueChangedSignal.Emit( self, clampedValue );
int markIndex;
if( MarkReached( percent, markIndex ) )
int markIndex;
if( MarkReached( percent, markIndex ) )
{
std::stringstream ss;
ss.precision( GetValuePrecision() );
{
std::stringstream ss;
ss.precision( GetValuePrecision() );
- ss << std::fixed << clampledValue;
+ ss << std::fixed << clampedValue;
- mHandleValueTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, ss.str() );
+ std::string label = mHandleValueTextLabel.GetProperty<std::string>( Toolkit::TextLabel::Property::TEXT );
+ if( label.compare(ss.str()) )
+ {
+ mHandleValueTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, ss.str() );
+ }