DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "enableEditing", BOOLEAN, ENABLE_EDITING )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "fontSizeScale", FLOAT, FONT_SIZE_SCALE )
DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "primaryCursorPosition", INTEGER, PRIMARY_CURSOR_POSITION )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit, TextField, "grabHandleColor", VECTOR4, GRAB_HANDLE_COLOR )
DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "maxLengthReached", SIGNAL_MAX_LENGTH_REACHED )
}
break;
}
+ case Toolkit::DevelTextField::Property::GRAB_HANDLE_COLOR:
+ {
+ const Vector4 color = value.Get<Vector4>();
+ DALI_LOG_INFO(gLogFilter, Debug::General, "TextField %p GRAB_HANDLE_COLOR %f,%f,%f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a);
+
+ impl.mDecorator->SetHandleColor(color);
+ impl.RequestTextRelayout();
+ break;
+ }
} // switch
} // textfield
}
value = static_cast<int>(impl.mController->GetPrimaryCursorPosition());
break;
}
+ case Toolkit::DevelTextField::Property::GRAB_HANDLE_COLOR:
+ {
+ value = impl.mDecorator->GetHandleColor();
+ break;
+ }
} //switch
}
void TextField::ResizeActor(Actor& actor, const Vector2& size)
{
- if (actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
+ if(actor.GetProperty<Vector3>(Dali::Actor::Property::SIZE).GetVectorXY() != size)
{
actor.SetProperty(Actor::Property::SIZE, size);
}
}
RenderText(updateTextType);
+
+ // If there is text changed, callback is called.
+ if(mTextChanged)
+ {
+ EmitTextChangedSignal();
+ }
}
// The text-field emits signals when the input style changes. These changes of style are
}
}
-void TextField::TextChanged()
+void TextField::TextChanged(bool immediate)
+{
+ if(immediate) // Emits TextChangedSignal immediately
+ {
+ EmitTextChangedSignal();
+ }
+ else
+ {
+ mTextChanged = true;
+ }
+}
+
+void TextField::EmitTextChangedSignal()
{
Dali::Toolkit::TextField handle(GetOwner());
mTextChangedSignal.Emit(handle);
+ mTextChanged = false;
}
void TextField::MaxLengthReached()
mAlignmentOffset(0.f),
mRenderingBackend(DEFAULT_RENDERING_BACKEND),
mExceedPolicy(Dali::Toolkit::TextField::EXCEED_POLICY_CLIP),
- mHasBeenStaged(false)
+ mHasBeenStaged(false),
+ mTextChanged(false)
{
}
{
using namespace Dali::Accessibility;
- auto states = Control::Impl::AccessibleImpl::CalculateStates();
+ auto states = DevelControl::AccessibleImpl::CalculateStates();
states[State::EDITABLE] = true;
states[State::FOCUSABLE] = true;