X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Ffocus-manager%2Ffocus-finder.cpp;h=c52bf57375a9d4a38d93f8a3cc0081087a2711c0;hb=fa834a987e844fb79531954c882581624aef0e68;hp=0cf66cdb708da5f03e5a86e3b06043de380b0d9c;hpb=a88db82a75443d573185aea2938f1f0be141ca64;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 0cf66cd..c52bf57 100644 --- a/dali-toolkit/devel-api/focus-manager/focus-finder.cpp +++ b/dali-toolkit/devel-api/focus-manager/focus-finder.cpp @@ -344,20 +344,19 @@ bool IsFocusable(Actor& actor) { return (actor.GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) && actor.GetProperty(Actor::Property::VISIBLE) && - actor.GetProperty(Actor::Property::SENSITIVE) && actor.GetProperty(Actor::Property::WORLD_COLOR).a > FULLY_TRANSPARENT); } Actor FindNextFocus(Actor& actor, Actor& focusedActor, Rect& focusedRect, Rect& bestCandidateRect, Toolkit::Control::KeyboardFocus::Direction direction) { Actor nearestActor; - if(actor) + if(actor && actor.GetProperty(Actor::Property::VISIBLE) && actor.GetProperty(DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN)) { // Recursively children const auto childCount = actor.GetChildCount(); - for(auto i = 0u; i < childCount; ++i) + for(auto i = childCount; i > 0u; --i) { - Dali::Actor child = actor.GetChildAt(i); + Dali::Actor child = actor.GetChildAt(i-1); if(child && child != focusedActor && IsFocusable(child)) { Rect candidateRect = DevelActor::CalculateScreenExtents(child); @@ -383,10 +382,10 @@ Actor FindNextFocus(Actor& actor, Actor& focusedActor, Rect& focusedRect, } // unnamed namespace -Actor GetNearestFocusableActor(Actor focusedActor, Toolkit::Control::KeyboardFocus::Direction direction) +Actor GetNearestFocusableActor(Actor rootActor, Actor focusedActor, Toolkit::Control::KeyboardFocus::Direction direction) { Actor nearestActor; - if(!focusedActor) + if(!focusedActor || !rootActor) { return nearestActor; } @@ -427,13 +426,7 @@ Actor GetNearestFocusableActor(Actor focusedActor, Toolkit::Control::KeyboardFoc ConvertCoordinate(bestCandidateRect); ConvertCoordinate(focusedRect); - - Integration::SceneHolder window = Integration::SceneHolder::Get(focusedActor); - if(window) - { - Actor rootActor = window.GetRootLayer(); - nearestActor = FindNextFocus(rootActor, focusedActor, focusedRect, bestCandidateRect, direction); - } + nearestActor = FindNextFocus(rootActor, focusedActor, focusedRect, bestCandidateRect, direction); return nearestActor; }