{
DALI_ASSERT_DEBUG( !mIsWaitingKeyboardFocusChangeCommit && "Calling this function in the PreFocusChangeSignal callback?" );
- if(actor)
+ if( actor )
{
- return DoSetCurrentFocusActor(actor.GetId());
+ return DoSetCurrentFocusActor( actor.GetId() );
}
return false;
{
if(actor)
{
- // Create focus group property if not already created.
- Property::Index propertyIsFocusGroup = actor.GetPropertyIndex(IS_FOCUS_GROUP_PROPERTY_NAME);
- if(propertyIsFocusGroup == Property::INVALID_INDEX)
- {
- actor.RegisterProperty(IS_FOCUS_GROUP_PROPERTY_NAME, isFocusGroup, Property::READ_WRITE );
- }
- else
- {
- actor.SetProperty(propertyIsFocusGroup, isFocusGroup);
- }
+ // Create/Set focus group property.
+ actor.RegisterProperty( IS_FOCUS_GROUP_PROPERTY_NAME, isFocusGroup, Property::READ_WRITE );
}
}
void KeyboardFocusManager::OnTouched(const TouchEvent& touchEvent)
{
- // Clear the focus when user touch the screen
- ClearFocus();
+ // Clear the focus when user touch the screen.
+ // We only do this on a Down event, otherwise the clear action may override a manually focused actor.
+ if( ( touchEvent.GetPointCount() < 1 ) || ( touchEvent.GetPoint( 0 ).state == TouchPoint::Down ) )
+ {
+ ClearFocus();
+ }
}
Toolkit::KeyboardFocusManager::PreFocusChangeSignalType& KeyboardFocusManager::PreFocusChangeSignal()