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
Actor GetNearestFocusableActor(Actor rootActor, Actor focusedActor, Toolkit::Control::KeyboardFocus::Direction direction)\r
{\r
Actor nearestActor;\r
- if(!focusedActor || !rootActor)\r
+ if(!rootActor)\r
{\r
return nearestActor;\r
}\r
\r
- Rect<float> focusedRect = DevelActor::CalculateScreenExtents(focusedActor);\r
+ Rect<float> focusedRect;\r
+ if (!focusedActor)\r
+ {\r
+ // If there is no currently focused actor, it is searched based on the upper left corner of the current window.\r
+ Rect<float> rootRect = DevelActor::CalculateScreenExtents(rootActor);\r
+ focusedRect = Rect<float>(rootRect.x, rootRect.y, 0.f, 0.f);\r
+ }\r
+ else\r
+ {\r
+ focusedRect = DevelActor::CalculateScreenExtents(focusedActor);\r
+ }\r
+\r
\r
// initialize the best candidate to something impossible\r
// (so the first plausible actor will become the best choice)\r