- case Toolkit::TextLabel::Property::TEXT_COLOR:
- {
- if( impl.mController )
- {
- const Vector4 textColor = value.Get< Vector4 >();
- if( impl.mController->GetTextColor() != textColor )
- {
- impl.mController->SetTextColor( textColor );
- impl.mRenderer.Reset();
- }
- }
- break;
- }
-
- case Toolkit::TextLabel::Property::SHADOW_OFFSET:
- {
- if( impl.mController )
- {
- const Vector2 shadowOffset = value.Get< Vector2 >();
- if ( impl.mController->GetShadowOffset() != shadowOffset )
- {
- impl.mController->SetShadowOffset( shadowOffset );
- impl.mRenderer.Reset();
- }
- }
- break;
- }
- case Toolkit::TextLabel::Property::SHADOW_COLOR:
- {
- if( impl.mController )
- {
- const Vector4 shadowColor = value.Get< Vector4 >();
- if ( impl.mController->GetShadowColor() != shadowColor )
- {
- impl.mController->SetShadowColor( shadowColor );
- impl.mRenderer.Reset();
- }
- }
- break;
- }
- case Toolkit::TextLabel::Property::UNDERLINE_COLOR:
- {
- if( impl.mController )
- {
- const Vector4 color = value.Get< Vector4 >();
- if ( impl.mController->GetUnderlineColor() != color )
- {
- impl.mController->SetUnderlineColor( color );
- impl.mRenderer.Reset();
- }
- }
- break;
- }
- case Toolkit::TextLabel::Property::UNDERLINE_ENABLED:
- {
- if( impl.mController )
- {
- const bool enabled = value.Get< bool >();
- if ( impl.mController->IsUnderlineEnabled() != enabled )
- {
- impl.mController->SetUnderlineEnabled( enabled );
- impl.mRenderer.Reset();
- }
- }
- break;
- }
-
- case Toolkit::TextLabel::Property::UNDERLINE_HEIGHT:
- {
- if( impl.mController )
- {
- float height = value.Get< float >();
- if( fabsf( impl.mController->GetUnderlineHeight() - height ) > Math::MACHINE_EPSILON_1000 )
- {
- impl.mController->SetUnderlineHeight( height );
- impl.mRenderer.Reset();
- }
- }
- break;
- }
- case Toolkit::TextLabel::Property::ENABLE_MARKUP:
- {
- if( impl.mController )
- {
- const bool enableMarkup = value.Get<bool>();
- impl.mController->SetMarkupProcessorEnabled( enableMarkup );
- }
- break;
- }
- case Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL:
- {
- if( impl.mController )
- {
- const bool enableAutoScroll = value.Get<bool>();
- // If request to auto scroll is the same as current state then do nothing.
- if ( enableAutoScroll != impl.mController->IsAutoScrollEnabled() )
- {
- // If request is disable (false) and auto scrolling is enabled then need to stop it
- if ( enableAutoScroll == false )
- {
- if( impl.mTextScroller )
- {
- impl.mTextScroller->SetLoopCount( 0 ); // Causes the current animation to finish playing (0)
- }
- }
- // If request is enable (true) then start autoscroll as not already running
- else
- {
- impl.mController->GetLayoutEngine().SetTextEllipsisEnabled( false );
- impl.mController->SetAutoScrollEnabled( enableAutoScroll );
- }
- }
- }
- break;
- }
- case Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED:
- {
- if( !impl.mTextScroller )
- {
- impl.mTextScroller = Text::TextScroller::New( impl );
- }
- impl.mTextScroller->SetSpeed( value.Get<int>() );
- break;
- }
- case Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT:
- {
- if( !impl.mTextScroller )
- {
- impl.mTextScroller = Text::TextScroller::New( impl );
- }
- impl.mTextScroller->SetLoopCount( value.Get<int>() );
- break;
- }
- case Toolkit::TextLabel::Property::AUTO_SCROLL_GAP:
- {
- if( !impl.mTextScroller )
- {
- impl.mTextScroller = Text::TextScroller::New( impl );
- }
- impl.mTextScroller->SetGap( value.Get<float>() );
- break;
- }
- case Toolkit::TextLabel::Property::LINE_SPACING:
- {
- if( impl.mController )
- {
- const float lineSpacing = value.Get<float>();
- impl.mController->SetDefaultLineSpacing( lineSpacing );
- impl.mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextLabel::Property::UNDERLINE:
- {
- const bool update = SetUnderlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
- if( update )
- {
- impl.mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextLabel::Property::SHADOW:
- {
- const bool update = SetShadowProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
- if( update )
- {
- impl.mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextLabel::Property::EMBOSS:
- {
- const bool update = SetEmbossProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
- if( update )
- {
- impl.mRenderer.Reset();
- }
- break;
- }
- case Toolkit::TextLabel::Property::OUTLINE:
- {
- const bool update = SetOutlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
- if( update )
- {
- impl.mRenderer.Reset();
- }
- break;
- }
- }