DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "ellipsisPosition", INTEGER, ELLIPSIS_POSITION )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "strikethrough", MAP, STRIKETHROUGH )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "inputStrikethrough", MAP, INPUT_STRIKETHROUGH )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "characterSpacing", FLOAT, CHARACTER_SPACING )
DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "maxLengthReached", SIGNAL_MAX_LENGTH_REACHED )
mActiveLayer.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
ResizeActor(mActiveLayer, contentSize);
}
+ if(mCursorLayer)
+ {
+ mCursorLayer.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
+ ResizeActor(mCursorLayer, contentSize);
+ }
// If there is text changed, callback is called.
if(mTextChanged)
}
}
-void TextField::AddDecoration(Actor& actor, bool needsClipping)
+void TextField::AddDecoration(Actor& actor, DecorationType type, bool needsClipping)
{
if(actor)
{
{
mClippingDecorationActors.push_back(actor);
}
- else
+
+ // If the actor is a layer type, add it.
+ if(type == DecorationType::ACTIVE_LAYER)
+ {
+ AddLayer(mActiveLayer, actor);
+ }
+ else if(type == DecorationType::CURSOR_LAYER)
{
- actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
- actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
- Self().Add(actor);
- mActiveLayer = actor;
+ AddLayer(mCursorLayer, actor);
}
}
}
+void TextField::AddLayer(Actor& layer, Actor& actor)
+{
+ actor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ Self().Add(actor);
+ layer = actor;
+}
+
void TextField::GetControlBackgroundColor(Vector4& color) const
{
Property::Value propValue = Self().GetProperty(Toolkit::Control::Property::BACKGROUND);
return true;
}
+Rect<> TextField::AccessibleImpl::GetRangeExtents(size_t startOffset, size_t endOffset, Accessibility::CoordinateType type)
+{
+ if (endOffset <= startOffset || endOffset <= 0)
+ {
+ return {0, 0, 0, 0};
+ }
+
+ auto self = Toolkit::TextField::DownCast(Self());
+ auto rect = Dali::Toolkit::GetImpl(self).GetTextController()->GetTextBoundingRectangle(startOffset, endOffset - 1);
+
+ auto componentExtents = this->GetExtents(type);
+
+ rect.x += componentExtents.x;
+ rect.y += componentExtents.y;
+
+ return rect;
+}
+
bool TextField::AccessibleImpl::CopyText(size_t startPosition, size_t endPosition)
{
if(endPosition <= startPosition)