DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "cursor-blink-interval", FLOAT, CURSOR_BLINK_INTERVAL )
DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "cursor-blink-duration", FLOAT, CURSOR_BLINK_DURATION )
DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "grab-handle-image", STRING, GRAB_HANDLE_IMAGE )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "grab-handle-pressed-image", VECTOR4, GRAB_HANDLE_PRESSED_IMAGE )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "grab-handle-pressed-image", STRING, GRAB_HANDLE_PRESSED_IMAGE )
DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "scroll-threshold", FLOAT, SCROLL_THRESHOLD )
DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "scroll-speed", FLOAT, SCROLL_SPEED )
DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-left", STRING, SELECTION_HANDLE_IMAGE_LEFT )
DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-right", STRING, SELECTION_HANDLE_IMAGE_RIGHT )
DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-left", STRING, SELECTION_HANDLE_PRESSED_IMAGE_LEFT )
DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-right", STRING, SELECTION_HANDLE_PRESSED_IMAGE_RIGHT )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-highlight-color", STRING, SELECTION_HIGHLIGHT_COLOR )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-highlight-color", VECTOR4, SELECTION_HIGHLIGHT_COLOR )
DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "decoration-bounding-box", RECTANGLE, DECORATION_BOUNDING_BOX )
DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "input-method-settings", MAP, INPUT_METHOD_SETTINGS )
const Vector4 color = value.Get< Vector4 >();
DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PRIMARY_CURSOR_COLOR %f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a );
- impl.mDecorator->SetColor( PRIMARY_CURSOR, color );
+ impl.mDecorator->SetCursorColor( PRIMARY_CURSOR, color );
impl.RequestTextRelayout();
}
break;
const Vector4 color = value.Get< Vector4 >();
DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SECONDARY_CURSOR_COLOR %f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a );
- impl.mDecorator->SetColor( SECONDARY_CURSOR, color );
+ impl.mDecorator->SetCursorColor( SECONDARY_CURSOR, color );
impl.RequestTextRelayout();
}
break;
mRenderer = Backend::Get().NewRenderer( mRenderingBackend );
}
- RenderText();
EnableClipping( (Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == mExceedPolicy), size );
+ RenderText();
}
}
void TextField::RenderText()
{
+ Actor self = Self();
Actor renderableActor;
if( mRenderer )
{
- renderableActor = mRenderer->Render( mController->GetView(), mDepth );
+ renderableActor = mRenderer->Render( mController->GetView(), self.GetHierarchyDepth() );
}
if( renderableActor != mRenderableActor )
mRenderableActor.SetPosition( offset.x, offset.y );
- // Make sure the actor is parented correctly with/without clipping
+ Actor clipRootActor;
if( mClipper )
{
- mClipper->GetRootActor().Add( mRenderableActor );
- }
- else
- {
- Self().Add( mRenderableActor );
+ clipRootActor = mClipper->GetRootActor();
}
for( std::vector<Actor>::const_iterator it = mClippingDecorationActors.begin(),
{
Actor actor = *it;
- if( mClipper )
+ if( clipRootActor )
{
- mClipper->GetRootActor().Add( actor );
+ clipRootActor.Add( actor );
}
else
{
- Self().Add( actor );
+ self.Add( actor );
}
}
mClippingDecorationActors.clear();
+
+ // Make sure the actor is parented correctly with/without clipping
+ if( clipRootActor )
+ {
+ clipRootActor.Add( mRenderableActor );
+ }
+ else
+ {
+ self.Add( mRenderableActor );
+ }
}
}
notifier.ContentSelectedSignal().Connect( this, &TextField::OnClipboardTextSelected );
}
- mController->KeyboardFocusGainEvent();
+ mController->KeyboardFocusGainEvent(); // Called in the case of no virtual keyboard to trigger this event
EmitKeyInputFocusSignal( true ); // Calls back into the Control hence done last.
}
}
else
{
- mController->KeyboardFocusGainEvent();
+ mController->KeyboardFocusGainEvent(); // Initially called by OnKeyInputFocusGained
}
}
void TextField::OnStageConnection( int depth )
{
- mDepth = depth;
+ // Call the Control::OnStageConnection() to set the depth of the background.
+ Control::OnStageConnection( depth );
+
+ // Sets the depth to the renderers inside the text's decorator.
+ mDecorator->SetTextDepth( depth );
+
+ // The depth of the text renderer is set in the RenderText() called from OnRelayout().
}
bool TextField::OnTouched( Actor actor, const TouchEvent& event )
: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
mRenderingBackend( DEFAULT_RENDERING_BACKEND ),
mExceedPolicy( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP ),
- mDepth( 0 ),
mHasBeenStaged( false )
{
}