X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Ffocus-manager%2Ffocus-finder.cpp;h=2fdf28552bc6fbb697a7f2ab79260a57ae9f0ed3;hb=145f62f674d8ae90930470756889e2346f7aa118;hp=c52bf57375a9d4a38d93f8a3cc0081087a2711c0;hpb=fa834a987e844fb79531954c882581624aef0e68;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/devel-api/focus-manager/focus-finder.cpp b/dali-toolkit/devel-api/focus-manager/focus-finder.cpp index c52bf57..2fdf285 100644 --- a/dali-toolkit/devel-api/focus-manager/focus-finder.cpp +++ b/dali-toolkit/devel-api/focus-manager/focus-finder.cpp @@ -343,6 +343,7 @@ bool IsBetterCandidate(Toolkit::Control::KeyboardFocus::Direction direction, Rec bool IsFocusable(Actor& actor) { return (actor.GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) && + actor.GetProperty(DevelActor::Property::USER_INTERACTION_ENABLED) && actor.GetProperty(Actor::Property::VISIBLE) && actor.GetProperty(Actor::Property::WORLD_COLOR).a > FULLY_TRANSPARENT); } @@ -385,12 +386,23 @@ Actor FindNextFocus(Actor& actor, Actor& focusedActor, Rect& focusedRect, Actor GetNearestFocusableActor(Actor rootActor, Actor focusedActor, Toolkit::Control::KeyboardFocus::Direction direction) { Actor nearestActor; - if(!focusedActor || !rootActor) + if(!rootActor) { return nearestActor; } - Rect focusedRect = DevelActor::CalculateScreenExtents(focusedActor); + Rect focusedRect; + if (!focusedActor) + { + // If there is no currently focused actor, it is searched based on the upper left corner of the current window. + Rect rootRect = DevelActor::CalculateScreenExtents(rootActor); + focusedRect = Rect(rootRect.x, rootRect.y, 0.f, 0.f); + } + else + { + focusedRect = DevelActor::CalculateScreenExtents(focusedActor); + } + // initialize the best candidate to something impossible // (so the first plausible actor will become the best choice)