Even if ELLIPSIS is set to false and ENABLE_AUTO_SCROLL is set to true, 11/234011/4
authorJoogab Yun <joogab.yun@samsung.com>
Thu, 21 May 2020 05:38:12 +0000 (14:38 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Fri, 22 May 2020 01:16:28 +0000 (10:16 +0900)
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

automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp

index 5735515..d420979 100755 (executable)
@@ -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<bool>( TextLabel::Property::ELLIPSIS ) );
+  }
+  catch( ... )
+  {
+    tet_result(TET_FAIL);
+  }
+
+  END_TEST;
+}
+
 int UtcDaliToolkitTextlabelEllipsis(void)
 {
   ToolkitTestApplication application;
index 2fddac3..e542d9c 100755 (executable)
@@ -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<Internal::Visual::Base&>( 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();
 }