From 6200daca3ea65d9eea188fc0885711bf156fbc64 Mon Sep 17 00:00:00 2001 From: Richard Huang Date: Thu, 15 May 2014 19:03:53 +0100 Subject: [PATCH] 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. --- .../focus-manager/keyboard-focus-manager-impl.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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() -- 2.7.4