X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fslider%2Fslider-impl.cpp;h=7ab8438ff341d2813a6e67f8c542f42404eee781;hp=56bbd339ea3b3f8880a401d0d83b96a98bf10796;hb=f5b98922d42457ef4e33c05dc1fb612fa24e888f;hpb=b458e407eba11c73f38da68bce8e967a30ea03e2 diff --git a/dali-toolkit/internal/controls/slider/slider-impl.cpp b/dali-toolkit/internal/controls/slider/slider-impl.cpp index 56bbd33..7ab8438 100755 --- a/dali-toolkit/internal/controls/slider/slider-impl.cpp +++ b/dali-toolkit/internal/controls/slider/slider-impl.cpp @@ -348,12 +348,13 @@ void Slider::DisplayValue( float value, bool raiseSignals ) } } - if( mHandleValueTextView ) + if( mHandleValueTextLabel ) { std::stringstream ss; ss.precision( GetValuePrecision() ); ss << std::fixed << clampledValue; - mHandleValueTextView.SetText( ss.str() ); + + mHandleValueTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, ss.str() ); } } @@ -397,6 +398,7 @@ Actor Slider::CreateHitRegion() ImageActor Slider::CreateBacking() { ImageActor backing = ImageActor::New(); + backing.SetRelayoutEnabled( false ); backing.SetParentOrigin( ParentOrigin::CENTER ); backing.SetAnchorPoint( AnchorPoint::CENTER ); backing.SetZ( BACKING_Z ); @@ -426,6 +428,7 @@ std::string Slider::GetBackingImageName() ImageActor Slider::CreateProgress() { ImageActor progress = ImageActor::New(); + progress.SetRelayoutEnabled( false ); progress.SetParentOrigin( ParentOrigin::CENTER_LEFT ); progress.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); progress.SetZ( PROGRESS_Z ); @@ -501,6 +504,7 @@ void Slider::ResizeProgressRegion( const Vector2& region ) ImageActor Slider::CreateHandle() { ImageActor handle = ImageActor::New(); + handle.SetRelayoutEnabled( false ); handle.SetParentOrigin( ParentOrigin::CENTER_LEFT ); handle.SetAnchorPoint( AnchorPoint::CENTER ); handle.SetZ( HANDLE_Z ); @@ -511,6 +515,7 @@ ImageActor Slider::CreateHandle() ImageActor Slider::CreatePopupArrow() { ImageActor arrow = ImageActor::New(); + arrow.SetRelayoutEnabled( false ); arrow.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); arrow.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); arrow.SetZ( HANDLE_Z ); @@ -518,24 +523,26 @@ ImageActor Slider::CreatePopupArrow() return arrow; } -Toolkit::TextView Slider::CreatePopupText() +Toolkit::TextLabel Slider::CreatePopupText() { - Toolkit::TextView textView = Toolkit::TextView::New(); - textView.SetParentOrigin( ParentOrigin::CENTER ); - textView.SetAnchorPoint( AnchorPoint::CENTER ); - textView.SetSizePolicy( Toolkit::Control::Flexible, Toolkit::Control::Flexible ); - textView.SetZ( VALUE_DISPLAY_TEXT_Z ); - return textView; + Toolkit::TextLabel textLabel = Toolkit::TextLabel::New(); + textLabel.SetParentOrigin( ParentOrigin::CENTER ); + textLabel.SetAnchorPoint( AnchorPoint::CENTER ); + textLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); + textLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); + textLabel.SetZ( VALUE_DISPLAY_TEXT_Z ); + return textLabel; } ImageActor Slider::CreatePopup() { ImageActor popup = ImageActor::New(); + popup.SetRelayoutEnabled( false ); popup.SetParentOrigin( ParentOrigin::TOP_CENTER ); popup.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); - mValueTextView = CreatePopupText(); - popup.Add( mValueTextView ); + mValueTextLabel = CreatePopupText(); + popup.Add( mValueTextLabel ); return popup; } @@ -569,24 +576,21 @@ void Slider::ResizeHandleRegion( const Vector2& region ) void Slider::CreateHandleValueDisplay() { - if( mHandle && !mHandleValueTextView ) + if( mHandle && !mHandleValueTextLabel ) { - mHandleValueTextView = Toolkit::TextView::New(); - mHandleValueTextView.SetParentOrigin( ParentOrigin::CENTER ); - mHandleValueTextView.SetAnchorPoint( AnchorPoint::CENTER ); - mHandleValueTextView.SetSize( GetHandleRegion() ); - mHandleValueTextView.SetZ( HANDLE_VALUE_DISPLAY_TEXT_Z ); - mHandle.Add( mHandleValueTextView ); + mHandleValueTextLabel = Toolkit::TextLabel::New(); + mHandleValueTextLabel.SetParentOrigin( ParentOrigin::CENTER ); + mHandleValueTextLabel.SetAnchorPoint( AnchorPoint::CENTER ); + mHandleValueTextLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); + mHandleValueTextLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); + mHandleValueTextLabel.SetDrawMode( DrawMode::OVERLAY ); + mHandle.Add( mHandleValueTextLabel ); } } void Slider::DestroyHandleValueDisplay() { - if(mHandleValueTextView) - { - mHandleValueTextView.Unparent(); - mHandleValueTextView.Reset(); - } + UnparentAndReset(mHandleValueTextLabel); } void Slider::SetPopupTextColor( const Vector4& color ) @@ -1013,26 +1017,15 @@ bool Slider::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tr void Slider::DisplayPopup( float value ) { // Value displayDoConnectSignal - if( mValueTextView ) + if( mValueTextLabel ) { std::stringstream ss; ss.precision( GetValuePrecision() ); ss << std::fixed << value; - mValueTextView.SetText( ss.str() ); - TextStyle style; - style.SetTextColor( GetPopupTextColor() ); - mValueTextView.SetStyleToCurrentText( style, TextStyle::COLOR); + mValueTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, ss.str() ); if( mValueDisplay ) { - Font font = Font::New(); - float popupWidth = font.MeasureText( ss.str() ).x + VALUE_POPUP_MARGIN * 2.0f; - if( popupWidth < VALUE_POPUP_MIN_WIDTH ) - { - popupWidth = VALUE_POPUP_MIN_WIDTH; - } - - mPopup.SetSize( popupWidth, VALUE_POPUP_HEIGHT ); mValueDisplay.SetVisible( true ); mValueTimer.SetInterval( VALUE_VIEW_SHOW_DURATION );