From: xb.teng Date: Wed, 25 Jul 2018 10:00:31 +0000 (+0800) Subject: Fix focus issue after calling ClearFocus api X-Git-Tag: dali_1.3.35~1^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=f7e78caead4596a66b750444e77343856432d36d;hp=c7ecf3ad7916ef6897fa192ea02ff7b1b2fc1bd8;ds=sidebyside Fix focus issue after calling ClearFocus api After calling ClearFocus api, mIsFocusIndicatorEnabled will be 0. In this case, if you call SetCurrentFocusActor again, then the first pressed direction key is valid, but the second pressed direction key can works. It's an issue. Change-Id: I0d731263f11b40fa3211fd64388f8c9da5707fc9 --- diff --git a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp index 3f398c5..9e34984 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -672,12 +672,9 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event) // Show focus indicator mIsFocusIndicatorEnabled = 1; } - else - { - // Move the focus towards left - MoveFocus(Toolkit::Control::KeyboardFocus::LEFT); - } + // Move the focus towards left + MoveFocus(Toolkit::Control::KeyboardFocus::LEFT); isFocusStartableKey = true; } else @@ -695,11 +692,9 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event) // Show focus indicator mIsFocusIndicatorEnabled = 1; } - else - { - // Move the focus towards right - MoveFocus(Toolkit::Control::KeyboardFocus::RIGHT); - } + + // Move the focus towards right + MoveFocus(Toolkit::Control::KeyboardFocus::RIGHT); } else { @@ -716,12 +711,9 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event) // Show focus indicator mIsFocusIndicatorEnabled = 1; } - else - { - // Move the focus towards up - MoveFocus(Toolkit::Control::KeyboardFocus::UP); - } + // Move the focus towards up + MoveFocus(Toolkit::Control::KeyboardFocus::UP); isFocusStartableKey = true; } else if (keyName == "Down" && !isAccessibilityEnabled) @@ -731,12 +723,9 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event) // Show focus indicator mIsFocusIndicatorEnabled = 1; } - else - { - // Move the focus towards down - MoveFocus(Toolkit::Control::KeyboardFocus::DOWN); - } + // Move the focus towards down + MoveFocus(Toolkit::Control::KeyboardFocus::DOWN); isFocusStartableKey = true; } else if (keyName == "Prior" && !isAccessibilityEnabled) @@ -746,11 +735,9 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event) // Show focus indicator mIsFocusIndicatorEnabled = 1; } - else - { - // Move the focus towards the previous page - MoveFocus(Toolkit::Control::KeyboardFocus::PAGE_UP); - } + + // Move the focus towards the previous page + MoveFocus(Toolkit::Control::KeyboardFocus::PAGE_UP); isFocusStartableKey = true; } @@ -761,11 +748,9 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event) // Show focus indicator mIsFocusIndicatorEnabled = 1; } - else - { - // Move the focus towards the next page - MoveFocus(Toolkit::Control::KeyboardFocus::PAGE_DOWN); - } + + // Move the focus towards the next page + MoveFocus(Toolkit::Control::KeyboardFocus::PAGE_DOWN); isFocusStartableKey = true; }