[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.
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()