From: Richard Huang Date: Thu, 15 May 2014 18:03:53 +0000 (+0100) Subject: New focus indicator should be added to the current focused actor immediately X-Git-Tag: dali-2014-wk21-release~10 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=6200daca3ea65d9eea188fc0885711bf156fbc64 New focus indicator should be added to the current focused actor immediately [problem] When focus indicator is changed, it is not immediately reflected. [cause] It doesn't remove the old indicator from the current focused actor and add the new one to. [solution] Remove the original focus indicator and add the new indicator to the current focused actor. --- diff --git a/base/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp b/base/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp index 193d985..1889edb 100644 --- a/base/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/base/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -414,7 +414,25 @@ Actor KeyboardFocusManager::GetFocusGroup(Actor actor) void KeyboardFocusManager::SetFocusIndicatorActor(Actor indicator) { - mFocusIndicatorActor = indicator; + if(mFocusIndicatorActor != indicator) + { + Actor currentFocusActor = GetCurrentFocusActor(); + if(currentFocusActor) + { + // The new focus indicator should be added to the current focused actor immediately + if(mFocusIndicatorActor) + { + currentFocusActor.Remove(mFocusIndicatorActor); + } + + if(indicator) + { + currentFocusActor.Add(indicator); + } + } + + mFocusIndicatorActor = indicator; + } } Actor KeyboardFocusManager::GetFocusIndicatorActor()