[Tizen] Add ellipsis mode to text label 17/321517/1 accepted/tizen_9.0_unified tizen_9.0 accepted/tizen/9.0/unified/20250410.163732
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 7 Mar 2025 10:57:59 +0000 (19:57 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Mon, 24 Mar 2025 09:14:23 +0000 (18:14 +0900)
Added ELLIPSIS_MODE to automatically support auto scroll.

In case of Ellipsize::AUTO_SCROLL,
when the text exceeds the layout, it will automatically scroll with animation.

Below are some limitations:

Ellipsize::AUTO_SCROLL shares the properties of AUTO_SCROLL Animation:
AUTO_SCROLL_SPEED, AUTO_SCROLL_LOOP_COUNT, AUTO_SCROLL_GAP, AUTO_SCROLL_LOOP_DELAY

Ellipsize::AUTO_SCROLL forces the setting of AUTO_SCROLL_STOP_MODE to IMMEDIATE.

To dynamically turn off Ellipsize::AUTO_SCROLL, set Ellipsize::TRUNCATE.
Cannot be used simultaneously with ENABLE_AUTO_SCROLL.

Change-Id: I0473f774505378273a05f07f6ee864ecae79abff
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-TextLabel-Async.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
dali-toolkit/devel-api/controls/text-controls/text-label-devel.h
dali-toolkit/devel-api/text/text-enumerations-devel.h
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/text/async-text/async-text-loader.h
dali-toolkit/internal/text/async-text/text-loading-task.cpp
dali-toolkit/internal/text/controller/text-controller-impl.cpp
dali-toolkit/internal/text/controller/text-controller-impl.h
dali-toolkit/internal/text/controller/text-controller.cpp
dali-toolkit/internal/text/controller/text-controller.h

index 9e1c5eb268904b66621aed01a9528d1caf6c3ffd..8826eb96246fbb731559b695f0bf750eb37d9db2 100644 (file)
@@ -2765,5 +2765,64 @@ int UtcDaliToolkitTextLabelAsyncTextMultiline(void)
   DALI_TEST_EQUALS(expectedHeight, gAsyncTextRenderedHeight, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
   DALI_TEST_EQUALS(true, label.GetProperty<bool>(DevelTextLabel::Property::MANUAL_RENDERED), TEST_LOCATION);
 
+  END_TEST;
+}
+
+int UtcDaliToolkitTextLabelAsyncTextEllipsisMode(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelAsyncTextEllipsisMode");
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+  // Set the dpi of AsyncTextLoader and FontClient to be identical.
+  TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+
+  // Set short text.
+  TextLabel label = TextLabel::New("H");
+  DALI_TEST_CHECK(label);
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+  application.GetScene().Add(label);
+
+  label.SetProperty(DevelTextLabel::Property::RENDER_MODE, DevelTextLabel::Render::ASYNC_AUTO);
+  label.SetProperty(TextLabel::Property::ELLIPSIS, true);
+  label.SetProperty(TextLabel::Property::MULTI_LINE, false);
+  label.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+  label.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+  label.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 40.f));
+
+  // Set ellipsis mode to auto scroll, but auto scroll does not work because the text is short.
+  label.SetProperty(DevelTextLabel::Property::ELLIPSIS_MODE, Toolkit::DevelText::Ellipsize::AUTO_SCROLL);
+  try
+  {
+    application.SendNotification();
+    application.Render();
+  }
+  catch(...)
+  {
+    tet_result(TET_FAIL);
+  }
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1, ASYNC_TEXT_THREAD_TIMEOUT), true, TEST_LOCATION);
+  DALI_TEST_CHECK(!label.GetProperty<bool>(DevelTextLabel::Property::IS_SCROLLING));
+
+  // Set long text to scroll.
+  label.SetProperty(TextLabel::Property::TEXT, "Hello world Hello world Hello world Hello world");
+  label.SetProperty(TextLabel::Property::ENABLE_AUTO_SCROLL, false);
+  try
+  {
+    application.SendNotification();
+    application.Render();
+  }
+  catch(...)
+  {
+    tet_result(TET_FAIL);
+  }
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1, ASYNC_TEXT_THREAD_TIMEOUT), true, TEST_LOCATION);
+  DALI_TEST_CHECK(label.GetProperty<bool>(DevelTextLabel::Property::IS_SCROLLING));
+
   END_TEST;
 }
\ No newline at end of file
index 2784930147205ddba9b37bc7d6764a18692614ab..152f9fd991439ed962817ccefe09b5da3d6f79fc 100644 (file)
@@ -87,6 +87,7 @@ const char* const PROPERTY_NAME_REMOVE_CUTOUT         = "cutout";
 const char* const PROPERTY_NAME_RENDER_MODE           = "renderMode";
 const char* const PROPERTY_NAME_MANUAL_RENDERED       = "manualRendered";
 const char* const PROPERTY_NAME_ASYNC_LINE_COUNT      = "asyncLineCount";
+const char* const PROPERTY_NAME_ELLIPSIS_MODE         = "ellipsisMode";
 
 const std::string  DEFAULT_FONT_DIR("/resources/fonts");
 const unsigned int EMOJI_FONT_SIZE = 3840u; // 60 * 64
@@ -374,6 +375,7 @@ int UtcDaliToolkitTextLabelGetPropertyP(void)
   DALI_TEST_CHECK(label.GetPropertyIndex(PROPERTY_NAME_RENDER_MODE) == DevelTextLabel::Property::RENDER_MODE);
   DALI_TEST_CHECK(label.GetPropertyIndex(PROPERTY_NAME_MANUAL_RENDERED) == DevelTextLabel::Property::MANUAL_RENDERED);
   DALI_TEST_CHECK(label.GetPropertyIndex(PROPERTY_NAME_ASYNC_LINE_COUNT) == DevelTextLabel::Property::ASYNC_LINE_COUNT);
+  DALI_TEST_CHECK(label.GetPropertyIndex(PROPERTY_NAME_ELLIPSIS_MODE) == DevelTextLabel::Property::ELLIPSIS_MODE);
 
   END_TEST;
 }
@@ -1072,6 +1074,13 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   label.SetProperty(DevelTextLabel::Property::RENDER_MODE, 3);
   DALI_TEST_EQUALS(label.GetProperty<int>(DevelTextLabel::Property::RENDER_MODE), static_cast<int>(DevelTextLabel::Render::SYNC), TEST_LOCATION);
 
+  // Check ellipsis mode property
+  label.SetProperty(DevelTextLabel::Property::ELLIPSIS_MODE, Toolkit::DevelText::Ellipsize::TRUNCATE);
+  DALI_TEST_EQUALS(label.GetProperty<int>(DevelTextLabel::Property::ELLIPSIS_MODE), static_cast<int>(Toolkit::DevelText::Ellipsize::TRUNCATE), TEST_LOCATION);
+
+  label.SetProperty(DevelTextLabel::Property::ELLIPSIS_MODE, Toolkit::DevelText::Ellipsize::AUTO_SCROLL);
+  DALI_TEST_EQUALS(label.GetProperty<int>(DevelTextLabel::Property::ELLIPSIS_MODE), static_cast<int>(Toolkit::DevelText::Ellipsize::AUTO_SCROLL), TEST_LOCATION);
+
   application.SendNotification();
   application.Render();
 
@@ -1723,6 +1732,74 @@ int UtcDaliToolkitTextlabelEllipsis(void)
   END_TEST;
 }
 
+int UtcDaliToolkitTextlabelEllipsisMode(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextlabelEllipsisMode");
+
+  // Set short text.
+  TextLabel label = TextLabel::New("H");
+  DALI_TEST_CHECK(label);
+
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE);
+
+  application.GetScene().Add(label);
+
+  label.SetProperty(TextLabel::Property::ELLIPSIS, true);
+  label.SetProperty(TextLabel::Property::MULTI_LINE, false);
+  label.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+  label.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+  label.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 40.f));
+
+  // Set ellipsis mode to auto scroll, but auto scroll does not work because the text is short.
+  label.SetProperty(DevelTextLabel::Property::ELLIPSIS_MODE, Toolkit::DevelText::Ellipsize::AUTO_SCROLL);
+
+  // When ellipsis mode is auto scroll, enable auto scroll does not work.
+  label.SetProperty(TextLabel::Property::ENABLE_AUTO_SCROLL, true);
+  try
+  {
+    application.SendNotification();
+    application.Render();
+  }
+  catch(...)
+  {
+    tet_result(TET_FAIL);
+  }
+  DALI_TEST_CHECK(!label.GetProperty<bool>(TextLabel::Property::ENABLE_AUTO_SCROLL));
+  DALI_TEST_CHECK(!label.GetProperty<bool>(DevelTextLabel::Property::IS_SCROLLING));
+
+  // Set long text to scroll.
+  label.SetProperty(TextLabel::Property::TEXT, "Hello world Hello world Hello world Hello world");
+  label.SetProperty(TextLabel::Property::ENABLE_AUTO_SCROLL, false);
+  try
+  {
+    application.SendNotification();
+    application.Render();
+  }
+  catch(...)
+  {
+    tet_result(TET_FAIL);
+  }
+  DALI_TEST_CHECK(label.GetProperty<bool>(DevelTextLabel::Property::IS_SCROLLING));
+
+  // Auto scroll does not work in multi line.
+  label.SetProperty(TextLabel::Property::MULTI_LINE, true);
+  label.SetProperty(DevelTextLabel::Property::ELLIPSIS_MODE, Toolkit::DevelText::Ellipsize::TRUNCATE);
+  try
+  {
+    application.SendNotification();
+    application.Render();
+  }
+  catch(...)
+  {
+    tet_result(TET_FAIL);
+  }
+  DALI_TEST_CHECK(!label.GetProperty<bool>(DevelTextLabel::Property::IS_SCROLLING));
+
+  END_TEST;
+}
+
 int UtcDaliToolkitTextlabelTextWrapMode(void)
 {
   ToolkitTestApplication application;
index 50acf5ef1d113de3e30aca391aa180fffb80f3bb..02e4f0170d258a25aeb53acfdd66236bb61ad4f1 100644 (file)
@@ -275,6 +275,19 @@ enum Type
    * @note This property is read-only.
    */
   ASYNC_LINE_COUNT,
+
+  /**
+   * @brief Ellipsis mode.
+   * @details Name "ellipsisMode", type Property::INTERGER.
+   */
+  ELLIPSIS_MODE,
+
+  /**
+   * @brief Whether the auto scroll animation is playing or not.
+   * @details Name "isScrolling", type Property::BOOLEAN.
+   * @note This property is read-only.
+   */
+  IS_SCROLLING,
 };
 
 } // namespace Property
index 100d59eef2ff8f149ac737c47ef15964ad65a513..fa9dfcb85b3b6f143bfd498a641383491ea1fc39 100644 (file)
@@ -145,6 +145,20 @@ enum Type
 
 } // namespace EllipsisPosition
 
+namespace Ellipsize
+{
+/**
+ * @brief Enumerations specifying ellipsize mode.
+ * @see EllipsisMode.
+ */
+enum Mode
+{
+  TRUNCATE = 0, ///< If the text exceeds the layout, it will be truncated with an ellipsis.
+  AUTO_SCROLL   ///< If the text exceeds the layout, it will be auto scroll animated.
+};
+
+} // namespace EllipsisMode
+
 } // namespace DevelText
 
 } // namespace Toolkit
index 470d5bf60e4e87f7a428a8de0a25563a4ade16e6..4bbb1d147d2daef9a82616527a4646172371b0a5 100644 (file)
@@ -153,6 +153,8 @@ DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextLabel, "cutout",
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextLabel, "renderMode",                   INTEGER, RENDER_MODE                    )
 DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY(Toolkit, TextLabel, "manualRendered",               BOOLEAN, MANUAL_RENDERED                )
 DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY(Toolkit, TextLabel, "asyncLineCount",               INTEGER, ASYNC_LINE_COUNT               )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextLabel, "ellipsisMode",                 INTEGER, ELLIPSIS_MODE                  )
+DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY(Toolkit, TextLabel, "isScrolling",                  BOOLEAN, IS_SCROLLING                   )
 
 DALI_ANIMATABLE_PROPERTY_REGISTRATION_WITH_DEFAULT(Toolkit, TextLabel, "textColor",      Color::BLACK,     TEXT_COLOR   )
 DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION(Toolkit,    TextLabel, "textColorRed",   TEXT_COLOR_RED,   TEXT_COLOR, 0)
@@ -390,25 +392,32 @@ void TextLabel::SetProperty(BaseObject* object, Property::Index index, const Pro
       }
       case Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL:
       {
-        const bool enableAutoScroll = value.Get<bool>();
-        impl.mLastAutoScrollEnabled = enableAutoScroll;
-        // If request to auto scroll is the same as current state then do nothing.
-        if(enableAutoScroll != impl.mController->IsAutoScrollEnabled())
+        if(impl.mController->IsTextElideEnabled() && impl.mController->GetEllipsisMode() == DevelText::Ellipsize::AUTO_SCROLL)
         {
-          // If request is disable (false) and auto scrolling is enabled then need to stop it
-          if(enableAutoScroll == false)
+          DALI_LOG_WARNING("Tried to autoscroll while in ellipsize auto scroll mode, request ignored.\n");
+        }
+        else
+        {
+          const bool enableAutoScroll = value.Get<bool>();
+          impl.mLastAutoScrollEnabled = enableAutoScroll;
+          // If request to auto scroll is the same as current state then do nothing.
+          if(enableAutoScroll != impl.mController->IsAutoScrollEnabled())
           {
-            if(impl.mTextScroller)
+            // If request is disable (false) and auto scrolling is enabled then need to stop it
+            if(enableAutoScroll == false)
             {
-              impl.mTextScroller->StopScrolling();
+              if(impl.mTextScroller)
+              {
+                impl.mTextScroller->StopScrolling();
+              }
             }
+            // If request is enable (true) then start autoscroll as not already running
+            else
+            {
+              impl.mController->SetAutoScrollEnabled(enableAutoScroll);
+            }
+            impl.mIsAsyncRenderNeeded = true;
           }
-          // If request is enable (true) then start autoscroll as not already running
-          else
-          {
-            impl.mController->SetAutoScrollEnabled(enableAutoScroll);
-          }
-          impl.mIsAsyncRenderNeeded = true;
         }
         break;
       }
@@ -490,6 +499,7 @@ void TextLabel::SetProperty(BaseObject* object, Property::Index index, const Pro
 
         impl.mController->SetTextElideEnabled(ellipsis);
         impl.mIsAsyncRenderNeeded = true;
+        impl.RequestTextRelayout();
         break;
       }
       case Toolkit::TextLabel::Property::LINE_WRAP_MODE:
@@ -571,7 +581,7 @@ void TextLabel::SetProperty(BaseObject* object, Property::Index index, const Pro
         if(!Equals(impl.mController->GetFontSizeScale(), scale))
         {
           impl.mController->SetFontSizeScale(scale);
-          impl.mIsAsyncRenderNeeded = true;
+          impl.mTextUpdateNeeded = true;
         }
         break;
       }
@@ -581,7 +591,7 @@ void TextLabel::SetProperty(BaseObject* object, Property::Index index, const Pro
         if(!Equals(impl.mController->IsFontSizeScaleEnabled(), enableFontSizeScale))
         {
           impl.mController->SetFontSizeScaleEnabled(enableFontSizeScale);
-          impl.mIsAsyncRenderNeeded = true;
+          impl.mTextUpdateNeeded = true;
         }
         break;
       }
@@ -593,6 +603,7 @@ void TextLabel::SetProperty(BaseObject* object, Property::Index index, const Pro
           DALI_LOG_INFO(gLogFilter, Debug::General, "TextLabel %p EllipsisPosition::Type %d\n", impl.mController.Get(), ellipsisPositionType);
           impl.mController->SetEllipsisPosition(ellipsisPositionType);
           impl.mIsAsyncRenderNeeded = true;
+          impl.RequestTextRelayout();
         }
         break;
       }
@@ -677,6 +688,23 @@ void TextLabel::SetProperty(BaseObject* object, Property::Index index, const Pro
         }
         break;
       }
+      case Toolkit::DevelTextLabel::Property::ELLIPSIS_MODE:
+      {
+        DevelText::Ellipsize::Mode ellipsisMode = static_cast<DevelText::Ellipsize::Mode>(value.Get<int>());
+        if(impl.mController->GetEllipsisMode() != ellipsisMode)
+        {
+          impl.mController->SetEllipsisMode(ellipsisMode);
+          Text::TextScrollerPtr textScroller = impl.GetTextScroller();
+          if(textScroller)
+          {
+            textScroller->SetStopMode(Toolkit::TextLabel::AutoScrollStopMode::IMMEDIATE);
+            textScroller->StopScrolling();
+          }
+          impl.mIsAsyncRenderNeeded = true;
+          impl.RequestTextRelayout();
+        }
+        break;
+      }
     }
 
     // Request relayout when text update is needed. It's necessary to call it
@@ -982,6 +1010,16 @@ Property::Value TextLabel::GetProperty(BaseObject* object, Property::Index index
         value = impl.mAsyncLineCount;
         break;
       }
+      case Toolkit::DevelTextLabel::Property::ELLIPSIS_MODE:
+      {
+        value = impl.mController->GetEllipsisMode();
+        break;
+      }
+      case Toolkit::DevelTextLabel::Property::IS_SCROLLING:
+      {
+        value = impl.mTextScroller && impl.mTextScroller->IsScrolling() ? true : false;
+        break;
+      }
     }
   }
 
@@ -1406,6 +1444,25 @@ void TextLabel::OnRelayout(const Vector2& size, RelayoutContainer& container)
     mController->SetTextFitContentSize(contentSize);
   }
 
+  if(mController->IsTextElideEnabled() && mController->GetEllipsisMode() == DevelText::Ellipsize::AUTO_SCROLL)
+  {
+    if(mController->IsMultiLineEnabled())
+    {
+      DALI_LOG_WARNING("Attempted ellipsize auto scroll on a non SINGLE_LINE_BOX, request ignored\n");
+    }
+    else
+    {
+      const Size naturalSize       = GetNaturalSize().GetVectorXY();
+      bool       autoScrollEnabled = contentSize.width < naturalSize.width ? true : false;
+      bool       requestRelayout   = false;
+
+      if(autoScrollEnabled != mController->IsAutoScrollEnabled())
+      {
+        mController->SetAutoScrollEnabled(autoScrollEnabled, requestRelayout);
+      }
+    }
+  }
+
   const Text::Controller::UpdateTextType updateTextType = mController->Relayout(contentSize, layoutDirection);
 
   if((Text::Controller::NONE_UPDATED != (Text::Controller::MODEL_UPDATED & updateTextType)) || mTextUpdateNeeded)
@@ -1540,7 +1597,8 @@ AsyncTextParameters TextLabel::GetAsyncTextParameters(const Async::RequestType r
   parameters.isTextFitArrayEnabled  = mController->IsTextFitArrayEnabled();
   parameters.textFitArray           = mController->GetTextFitArray();
   parameters.isAutoScrollEnabled    = mController->IsAutoScrollEnabled();
-  if(parameters.isAutoScrollEnabled)
+  parameters.ellipsisMode           = mController->GetEllipsisMode();
+  if(parameters.isAutoScrollEnabled || parameters.ellipsisMode == DevelText::Ellipsize::AUTO_SCROLL)
   {
     parameters.autoScrollStopMode  = GetTextScroller()->GetStopMode();
     parameters.autoScrollSpeed     = GetTextScroller()->GetSpeed();
index 79d3a9aea82b6c1cd8f47b0756ecc676074df2c1..a77c765d5b679f98746d5070334f4c1ed7b02fba 100644 (file)
@@ -96,6 +96,7 @@ struct AsyncTextParameters
     layoutDirection{Dali::LayoutDirection::LEFT_TO_RIGHT},
     layoutDirectionPolicy{DevelText::MatchLayoutDirection::INHERIT},
     ellipsisPosition{DevelText::EllipsisPosition::END},
+    ellipsisMode{DevelText::Ellipsize::TRUNCATE},
     isUnderlineEnabled{false},
     underlineType{Text::Underline::SOLID},
     underlineColor{Color::BLACK},
@@ -171,6 +172,7 @@ struct AsyncTextParameters
   Dali::LayoutDirection::Type            layoutDirection;       ///< The layout direction: one of {LEFT_TO_RIGHT, RIGHT_TO_LEFT}.
   DevelText::MatchLayoutDirection        layoutDirectionPolicy; ///< The policy used to set the text layout direction : one of {INHERIT, LOCALE, CONTENTS}.
   DevelText::EllipsisPosition::Type      ellipsisPosition;      ///< The position of the ellipsis glyph: one of {END, START, MIDDLE}.
+  DevelText::Ellipsize::Mode             ellipsisMode;          ///< The mode of the ellipsis: one of {TRUNCATE, AUTO_SCROLL}.
 
   bool                  isUnderlineEnabled : 1;     ///< Underline properties
   Text::Underline::Type underlineType;
index 10740e42b2f290dc1e479b86d23d6019aae716d8..1a4c13ad3d3bdba3ee20bda72773e0ff6c448b3f 100644 (file)
@@ -93,7 +93,33 @@ void TextLoadingTask::Load()
     case Text::Async::RENDER_FIXED_WIDTH:
     case Text::Async::RENDER_CONSTRAINT:
     {
-      if(mParameters.isAutoScrollEnabled && !mParameters.isMultiLine)
+      if(mParameters.ellipsis && !mParameters.isMultiLine && mParameters.ellipsisMode == DevelText::Ellipsize::AUTO_SCROLL)
+      {
+        Text::AsyncTextRenderInfo naturalSizeInfo;
+        naturalSizeInfo = mLoader.GetNaturalSize(mParameters);
+        if(mParameters.textWidth < naturalSizeInfo.renderedSize.width)
+        {
+#ifdef TRACE_ENABLED
+          if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+          {
+            DALI_LOG_RELEASE_INFO("RenderAutoScroll, Ellipsize::AUTO_SCROLL\n");
+          }
+#endif
+          mParameters.isAutoScrollEnabled = true;
+          mRenderInfo = mLoader.RenderAutoScroll(mParameters);
+        }
+        else
+        {
+#ifdef TRACE_ENABLED
+          if(gTraceFilter && gTraceFilter->IsTraceEnabled())
+          {
+            DALI_LOG_RELEASE_INFO("RenderText, Ellipsize::AUTO_SCROLL\n");
+          }
+#endif
+          mRenderInfo = mLoader.RenderText(mParameters);
+        }
+      }
+      else if(mParameters.isAutoScrollEnabled && !mParameters.isMultiLine)
       {
 #ifdef TRACE_ENABLED
         if(gTraceFilter && gTraceFilter->IsTraceEnabled())
index 2ddb46267b5a2e5365de2b5289ad4d56be68ac4d..5d1e77770dbbe851e41b69f134bbdac76507161f 100644 (file)
@@ -1918,7 +1918,7 @@ void Controller::Impl::CopyCharacterSpacingFromLogicalToVisualModels()
   mModel->mLogicalModel->mCharacterSpacingRunsUpdated = false;
 }
 
-void Controller::Impl::SetAutoScrollEnabled(bool enable)
+void Controller::Impl::SetAutoScrollEnabled(bool enable, bool requestRelayout)
 {
   if(mLayoutEngine.GetLayout() == Layout::Engine::SINGLE_LINE_BOX)
   {
@@ -1939,7 +1939,10 @@ void Controller::Impl::SetAutoScrollEnabled(bool enable)
     }
 
     mIsAutoScrollEnabled = enable;
-    RequestRelayout();
+    if(requestRelayout)
+    {
+      RequestRelayout();
+    }
   }
   else
   {
index dfc7116fb7ac2dccec4279c81c9da9bc6515b927..25bac7d2f8e28c27f7fb638f27c9f93c36dd8397 100644 (file)
@@ -386,7 +386,8 @@ public:
     mIsUserInteractionEnabled(true),
     mProcessorRegistered(false),
     mTextCutout(false),
-    mRenderMode(DevelTextLabel::Render::SYNC)
+    mRenderMode(DevelTextLabel::Render::SYNC),
+    mEllipsisMode(DevelText::Ellipsize::TRUNCATE)
   {
     mModel = Model::New();
 
@@ -917,7 +918,7 @@ public:
   /**
    * @copydoc Controller::SetAutoScrollEnabled()
    */
-  void SetAutoScrollEnabled(bool enable);
+  void SetAutoScrollEnabled(bool enable, bool requestRelayout);
 
   /**
    * @copydoc Controller::SetEnableCursorBlink()
@@ -1128,7 +1129,8 @@ public:
   bool  mProcessorRegistered : 1;      ///< Whether the text controller registered into processor or not.
   bool  mTextCutout : 1;               ///< Whether the text cutout enabled.
 
-  DevelTextLabel::Render::Mode mRenderMode; ///< Render mode of the text. (SYNC, ASYNC_AUTO, ASYNC_MANUAL)
+  DevelTextLabel::Render::Mode mRenderMode;   ///< Render mode of the text. (SYNC, ASYNC_AUTO, ASYNC_MANUAL)
+  DevelText::Ellipsize::Mode   mEllipsisMode; ///< Ellipsis mode of the text. (TRUNCATE, AUTO_SCROLL)
 
 private:
   friend ControllerImplEventHandler;
index 0b398ecd6e1c9a1fb077ac94b0af635a89fe98f8..e57f4499d6c6071a5fca93d979db1d69d99b1fb1 100644 (file)
@@ -174,10 +174,10 @@ bool Controller::HasAnchors() const
   return (mImpl->mMarkupProcessorEnabled && mImpl->mModel->mLogicalModel->mAnchors.Count() && mImpl->IsShowingRealText());
 }
 
-void Controller::SetAutoScrollEnabled(bool enable)
+void Controller::SetAutoScrollEnabled(bool enable, bool requestRelayout)
 {
   DALI_LOG_INFO(gLogFilter, Debug::General, "Controller::SetAutoScrollEnabled[%s] SingleBox[%s]-> [%p]\n", (enable) ? "true" : "false", (mImpl->mLayoutEngine.GetLayout() == Layout::Engine::SINGLE_LINE_BOX) ? "true" : "false", this);
-  mImpl->SetAutoScrollEnabled(enable);
+  mImpl->SetAutoScrollEnabled(enable, requestRelayout);
 }
 
 void Controller::SetAutoScrollMaxTextureExceeded(bool exceed)
@@ -1551,6 +1551,16 @@ void Controller::SetEllipsisPosition(Toolkit::DevelText::EllipsisPosition::Type
   mImpl->mModel->mVisualModel->SetEllipsisPosition(ellipsisPosition);
 }
 
+Toolkit::DevelText::Ellipsize::Mode Controller::GetEllipsisMode() const
+{
+  return mImpl->mEllipsisMode;
+}
+
+void Controller::SetEllipsisMode(Toolkit::DevelText::Ellipsize::Mode ellipsisMode)
+{
+  mImpl->mEllipsisMode = ellipsisMode;
+}
+
 void Controller::SetCharacterSpacing(float characterSpacing)
 {
   mImpl->mModel->mVisualModel->SetCharacterSpacing(characterSpacing);
index 867cdd8ae9d83d537f38880b99a8de2056680801..162b29911c073d9fba589508eddb4098b0eb0ef4 100644 (file)
@@ -261,8 +261,9 @@ public: // Configure the text controller.
    * By default is disabled.
    *
    * @param[in] enable Whether to enable the auto scrolling
+   * @param[in] requestRelayout Whether to request the relayout
    */
-  void SetAutoScrollEnabled(bool enable);
+  void SetAutoScrollEnabled(bool enable, bool requestRelayout = true);
 
   /**
    * @brief Whether the auto scrolling texture exceed max texture.
@@ -1865,6 +1866,18 @@ public: // Queries & retrieves.
    */
   void SetEllipsisPosition(Toolkit::DevelText::EllipsisPosition::Type ellipsisPosition);
 
+  /**
+   * @brief Retrieves ellipsis mode
+   * @return The ellipsis mode
+   */
+  Toolkit::DevelText::Ellipsize::Mode GetEllipsisMode() const;
+
+  /**
+   * @brief Sets ellipsis mode
+   * @param[in] ellipsisMode The ellipsis mode for the text
+   */
+  void SetEllipsisMode(Toolkit::DevelText::Ellipsize::Mode ellipsisMode);
+
   /**
    * @brief Retrieves ignoreSpaceAfterText value from model
    * @return The value of ignoreSpaceAfterText