END_TEST;
}
+
+int UtcDaliKeyboardFocusManagerWithUserInteractionEnabled(void)
+{
+ ToolkitTestApplication application;
+
+ tet_infoline(" UtcDaliKeyboardFocusManagerWithUserInteractionEnabled");
+
+ KeyboardFocusManager manager = KeyboardFocusManager::Get();
+ DALI_TEST_CHECK(manager);
+
+ // Create the first actor and add it to the stage
+ Actor first = Actor::New();
+ first.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ application.GetScene().Add(first);
+
+ // Create the second actor and add it to the first actor.
+ Actor second = Actor::New();
+ second.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+ first.Add(second);
+
+ // Check that no actor is being focused yet.
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor() == Actor());
+
+ // Check that the focus is set on the first actor
+ DALI_TEST_CHECK(manager.SetCurrentFocusActor(first) == true);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
+
+ // Set USER_INTERACTION_ENABLED false.
+ second.SetProperty(DevelActor::Property::USER_INTERACTION_ENABLED, false);
+
+ // Check that it will fail to set focus on the second actor as it's not userInteractionEnabled
+ DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == false);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor() == first);
+
+ // Set KeyboardFocusableChildren true.
+ second.SetProperty(DevelActor::Property::USER_INTERACTION_ENABLED, true);
+
+ // Check that the focus is set on the second actor
+ DALI_TEST_CHECK(manager.SetCurrentFocusActor(second) == true);
+ DALI_TEST_CHECK(manager.GetCurrentFocusActor() == second);
+
+ END_TEST;
+}
\ No newline at end of file
bool IsFocusable(Actor& actor)\r
{\r
return (actor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) &&\r
+ actor.GetProperty<bool>(DevelActor::Property::USER_INTERACTION_ENABLED) &&\r
actor.GetProperty<bool>(Actor::Property::VISIBLE) &&\r
actor.GetProperty<Vector4>(Actor::Property::WORLD_COLOR).a > FULLY_TRANSPARENT);\r
}\r
}
}
- if(actor && actor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) && actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
+ if(actor && actor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) && actor.GetProperty<bool>(DevelActor::Property::USER_INTERACTION_ENABLED) && actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
{
Integration::SceneHolder currentWindow = Integration::SceneHolder::Get(actor);
}
// Check whether the actor is in the stage and is keyboard focusable.
- if(actor && actor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) && actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
+ if(actor && actor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) && actor.GetProperty<bool>(DevelActor::Property::USER_INTERACTION_ENABLED) && actor.GetProperty<bool>(Actor::Property::CONNECTED_TO_SCENE))
{
if((mIsFocusIndicatorShown == SHOW) && (mEnableFocusIndicator == ENABLE))
{
}
}
- if(nextFocusableActor && nextFocusableActor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE))
+ if(nextFocusableActor && nextFocusableActor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) && nextFocusableActor.GetProperty<bool>(DevelActor::Property::USER_INTERACTION_ENABLED))
{
// Whether the next focusable actor is a layout control
if(IsLayoutControl(nextFocusableActor))
Actor nextFocusableActor = GetImplementation(control).GetNextKeyboardFocusableActor(actor, direction, mFocusGroupLoopEnabled);
if(nextFocusableActor)
{
- if(!nextFocusableActor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE))
+ if(!(nextFocusableActor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) || nextFocusableActor.GetProperty<bool>(DevelActor::Property::USER_INTERACTION_ENABLED)))
{
// If the actor is not focusable, ask the same layout control for the next actor to focus
return DoMoveFocusWithinLayoutControl(control, nextFocusableActor, direction);
mIsWaitingKeyboardFocusChangeCommit = false;
}
- if(committedFocusActor && committedFocusActor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE))
+ if(committedFocusActor && committedFocusActor.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) && committedFocusActor.GetProperty<bool>(DevelActor::Property::USER_INTERACTION_ENABLED))
{
// Whether the commited focusable actor is a layout control
if(IsLayoutControl(committedFocusActor))