DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "enableFontSizeScale", BOOLEAN, ENABLE_FONT_SIZE_SCALE )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "ellipsisPosition", INTEGER, ELLIPSIS_POSITION )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "strikethrough", MAP, STRIKETHROUGH )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "characterSpacing", FLOAT, CHARACTER_SPACING )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextLabel, "relativeLineSize", FLOAT, RELATIVE_LINE_SIZE )
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)
} // namespace
-Toolkit::TextLabel TextLabel::New()
+Toolkit::TextLabel TextLabel::New(ControlBehaviour additionalBehaviour)
{
// Create the implementation, temporarily owned by this handle on stack
- IntrusivePtr<TextLabel> impl = new TextLabel();
+ IntrusivePtr<TextLabel> impl = new TextLabel(additionalBehaviour);
// Pass ownership to CustomActor handle
Toolkit::TextLabel handle(*impl);
impl.mTextUpdateNeeded = SetStrikethroughProperties(impl.mController, value, Text::EffectStyle::DEFAULT) || impl.mTextUpdateNeeded;
break;
}
+ case Toolkit::DevelTextLabel::Property::CHARACTER_SPACING:
+ {
+ const float characterSpacing = value.Get<float>();
+ impl.mController->SetCharacterSpacing(characterSpacing);
+ break;
+ }
+ case Toolkit::DevelTextLabel::Property::RELATIVE_LINE_SIZE:
+ {
+ const float relativeLineSize = value.Get<float>();
+ DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextLabel %p RELATIVE_LINE_SIZE %f\n", impl.mController.Get(), relativeLineSize);
+
+ impl.mController->SetRelativeLineSize(relativeLineSize);
+ break;
+ }
}
// Request relayout when text update is needed. It's necessary to call it
GetStrikethroughProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
break;
}
+ case Toolkit::DevelTextLabel::Property::CHARACTER_SPACING:
+ {
+ value = impl.mController->GetCharacterSpacing();
+ break;
+ }
+ case Toolkit::DevelTextLabel::Property::RELATIVE_LINE_SIZE:
+ {
+ value = impl.mController->GetRelativeLineSize();
+ break;
+ }
}
}
CommonTextUtils::SynchronizeTextAnchorsInParent(Self(), mController, mAnchorActors);
}
-TextLabel::TextLabel()
-: Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT)),
+TextLabel::TextLabel(ControlBehaviour additionalBehavior)
+: Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT | additionalBehavior)),
mRenderingBackend(DEFAULT_RENDERING_BACKEND),
mTextUpdateNeeded(false)
{