* @details Name "cutout", type Property::BOOLEAN.
*/
CUTOUT,
+
+ /**
+ * @brief Whether to enable the async text load.
+ * @details Name "asyncLoad", type Property::BOOLEAN.
+ * @note Enables/disables the async text laod.
+ */
+ ASYNC_LOAD,
+
+ /**
+ * @brief Whether to enable the auto async text load.
+ * @details Name "autoAsyncLoad", type Property::BOOLEAN.
+ * @note If True, automatically requests an asynchronous text load in OnRelayout.
+ * This will only be effective when AsyncTextLoadEnabled is set to true.
+ */
+ AUTO_ASYNC_LOAD,
+
+ /**
+ * @brief Whether to property updated on async mode.
+ * @details Name "asyncPropertyUpdated", type Property::BOOLEAN.
+ * @note When the text property changes, the asyncPropertyUpdated flag becomes true,
+ * indicating that a new rendering needs to be performed.
+ * Once the new rendering is completed, this property is set back to false.
+ */
+ ASYNC_PROPERTY_UPDATED,
};
} // namespace Property
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "removeFrontInset", BOOLEAN, REMOVE_FRONT_INSET )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "removeBackInset", BOOLEAN, REMOVE_BACK_INSET )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "cutout", BOOLEAN, CUTOUT )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "asyncLoad", BOOLEAN, ASYNC_LOAD )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "autoAsyncLoad", BOOLEAN, AUTO_ASYNC_LOAD )
+DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY(Toolkit, TextLabel, "asyncPropertyUpdated", BOOLEAN, ASYNC_PROPERTY_UPDATED )
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)
impl.mIsPropertyUpdated = true;
break;
}
+ case Toolkit::DevelTextLabel::Property::ASYNC_LOAD:
+ {
+ const bool enable = value.Get<bool>();
+ if(impl.mController->IsAsyncTextLoadEnabled() != enable)
+ {
+ impl.mController->SetAsyncTextLoadEnabled(enable);
+ }
+ break;
+ }
+ case Toolkit::DevelTextLabel::Property::AUTO_ASYNC_LOAD:
+ {
+ const bool enable = value.Get<bool>();
+ if(impl.mController->IsAutoAsyncTextLoadEnabled() != enable)
+ {
+ impl.mController->SetAutoAsyncTextLoadEnabled(enable);
+ if(enable)
+ {
+ impl.mIsPropertyUpdated = true;
+ }
+ }
+ break;
+ }
}
// Request relayout when text update is needed. It's necessary to call it
value = impl.mController->IsTextCutout();
break;
}
+ case Toolkit::DevelTextLabel::Property::ASYNC_LOAD:
+ {
+ value = impl.mController->IsAsyncTextLoadEnabled();
+ break;
+ }
+ case Toolkit::DevelTextLabel::Property::AUTO_ASYNC_LOAD:
+ {
+ value = impl.mController->IsAutoAsyncTextLoadEnabled();
+ break;
+ }
+ case Toolkit::DevelTextLabel::Property::ASYNC_PROPERTY_UPDATED:
+ {
+ value = impl.mIsPropertyUpdated;
+ break;
+ }
}
}
{
DALI_LOG_INFO(gLogFilter, Debug::General, "TextLabel::OnRelayout\n");
+ if(mController->IsAsyncTextLoadEnabled() && !mController->IsAutoAsyncTextLoadEnabled())
+ {
+ return;
+ }
+
if(mTextScroller && mTextScroller->IsStop())
{
// When auto scroll is playing, it triggers a relayout only when an update is absolutely necessary.
std::swap(padding.start, padding.end);
}
- // FOR TEST
- mController->SetAsyncTextLoadEnabled(true);
-
if(mController->IsAsyncTextLoadEnabled())
{
if(mController->IsAutoScrollEnabled() && mTextScroller && mTextScroller->IsScrolling() && !mTextUpdateNeeded)
// When auto scroll is playing, a text load request is made only if a text update is absolutely necessary.
return;
}
+
if(!mIsPropertyUpdated)
{
return;
mIsUserInteractionEnabled(true),
mProcessorRegistered(false),
mTextCutout(false),
- mAsyncTextLoadEnabled(false)
+ mAsyncTextLoadEnabled(false),
+ mAutoAsyncTextLoadEnabled(true)
{
mModel = Model::New();
bool mProcessorRegistered : 1; ///< Whether the text controller registered into processor or not.
bool mTextCutout : 1; ///< Whether the text cutout enabled.
bool mAsyncTextLoadEnabled : 1; ///< Whether the async text load is enabled.
+ bool mAutoAsyncTextLoadEnabled : 1; ///< Whether the auto async text load is enabled.
private:
friend ControllerImplEventHandler;
*/
bool IsAsyncTextLoadEnabled() const;
+ /**
+ * @brief Enables/disables the auto async text laod.
+ *
+ * If True, automatically requests an asynchronous text load in OnRelayout.
+ * This will only be effective when AsyncTextLoadEnabled is set to true.
+ * By default is enabled.
+ *
+ * @param[in] enable Whether to enable the auto async text load.
+ */
+ void SetAutoAsyncTextLoadEnabled(bool enable);
+
+ /**
+ * @brief Retrieves whether the auto async text load is enabled.
+ *
+ * By default is enabled.
+ *
+ * @return @e true if the auto async text load is enabled, otherwise returns @e false.
+ */
+ bool IsAutoAsyncTextLoadEnabled() const;
+
public: // Relayout.
/**
* @brief Triggers a relayout which updates View (if necessary).