From 9586f40d19b66c16e7daed9df3f58aeef82b3282 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Thu, 21 May 2020 14:38:12 +0900 Subject: [PATCH] Even if ELLIPSIS is set to false and ENABLE_AUTO_SCROLL is set to true, Ellipsis is alaways set to true when scrolling is finished. Do not change user settings. textLabel.SetProperty(TextLabel::Property::ELLIPSIS, false); textLabel.SetProperty(TextLabel::Property::ENABLE_AUTO_SCROLL, true); Change-Id: I98703d5c25237901812af568a1f2ca4c6c143889 --- .../src/dali-toolkit/utc-Dali-TextLabel.cpp | 45 ++++++++++++++++++++++ .../controls/text-controls/text-label-impl.cpp | 3 +- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp index 5735515..d420979 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -1105,6 +1105,51 @@ int UtcDaliToolkitTextlabelScrollingN(void) END_TEST; } +int UtcDaliToolkitTextlabelScrollingWithEllipsis(void) +{ + ToolkitTestApplication application; + tet_infoline(" UtcDaliToolkitTextlabelScrollingWithEllipsis"); + + TextLabel label = TextLabel::New("Some text to scroll"); + DALI_TEST_CHECK( label ); + + Stage::GetCurrent().Add( label ); + + // Avoid a crash when core load gl resources. + application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); + + // Turn on all the effects. + label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f ); + label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 ); + label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f ); + + try + { + // Enable the auto scrolling effect. + label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true ); + label.SetProperty( TextLabel::Property::AUTO_SCROLL_STOP_MODE, TextLabel::AutoScrollStopMode::IMMEDIATE ); + + // Disable the ellipsis + label.SetProperty( TextLabel::Property::ELLIPSIS, false ); + + // Render the text. + application.SendNotification(); + application.Render(); + + // Stop auto scrolling + label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false ); + + // Check the ellipsis property + DALI_TEST_CHECK( !label.GetProperty( TextLabel::Property::ELLIPSIS ) ); + } + catch( ... ) + { + tet_result(TET_FAIL); + } + + END_TEST; +} + int UtcDaliToolkitTextlabelEllipsis(void) { ToolkitTestApplication application; diff --git a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp index 2fddac3..e542d9c 100755 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -1076,6 +1076,7 @@ void TextLabel::SetUpAutoScrolling() const int maxTextureSize = Dali::GetMaxTextureSize(); //if the texture size width exceed maxTextureSize, modify the visual model size and enabled the ellipsis + bool actualellipsis = mController->IsTextElideEnabled(); if( verifiedSize.width > maxTextureSize ) { verifiedSize.width = maxTextureSize; @@ -1108,6 +1109,7 @@ void TextLabel::SetUpAutoScrolling() // Set parameters for scrolling Renderer renderer = static_cast( GetImplementation( mVisual ) ).GetRenderer(); mTextScroller->SetParameters( Self(), renderer, textureSet, controlSize, verifiedSize, wrapGap, direction, mController->GetHorizontalAlignment(), mController->GetVerticalAlignment() ); + mController->SetTextElideEnabled( actualellipsis ); } void TextLabel::ScrollingFinished() @@ -1115,7 +1117,6 @@ void TextLabel::ScrollingFinished() // Pure Virtual from TextScroller Interface DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::ScrollingFinished\n"); mController->SetAutoScrollEnabled( false ); - mController->SetTextElideEnabled( true ); RequestTextRelayout(); } -- 2.7.4