Do not clear keyboard focus on touch when alwaysShowFocus is ture.
TV app developer can use this feature to keep showing focus to app user.
Change-Id: I00c52244047172cb9d52310d3767a0eae3b67ef0
Signed-off-by: minho.sun <minho.sun@samsung.com>
mIsFocusIndicatorEnabled( -1 ),
mFocusGroupLoopEnabled( false ),
mIsWaitingKeyboardFocusChangeCommit( false ),
mIsFocusIndicatorEnabled( -1 ),
mFocusGroupLoopEnabled( false ),
mIsWaitingKeyboardFocusChangeCommit( false ),
+ mClearFocusOnTouch( true ),
mFocusHistory(),
mSlotDelegate( this ),
mCustomAlgorithmInterface(NULL)
mFocusHistory(),
mSlotDelegate( this ),
mCustomAlgorithmInterface(NULL)
{
Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager );
mIsFocusIndicatorEnabled = static_cast<int>(config["alwaysShowFocus"].Get<bool>());
{
Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager );
mIsFocusIndicatorEnabled = static_cast<int>(config["alwaysShowFocus"].Get<bool>());
+ mClearFocusOnTouch = mIsFocusIndicatorEnabled ? false : true;
void KeyboardFocusManager::OnTouch(const TouchData& touch)
{
void KeyboardFocusManager::OnTouch(const TouchData& touch)
{
+ // if mIsFocusIndicatorEnabled is -1, it means Configuration is not loaded.
+ // Try to load configuration.
+ if( mIsFocusIndicatorEnabled == -1 )
+ {
+ GetConfigurationFromStyleManger();
+ }
+
// Clear the focus when user touch the screen.
// We only do this on a Down event, otherwise the clear action may override a manually focused actor.
// Clear the focus when user touch the screen.
// We only do this on a Down event, otherwise the clear action may override a manually focused actor.
- if( ( touch.GetPointCount() < 1 ) || ( touch.GetState( 0 ) == PointState::DOWN ) )
+ // If mClearFocusOnTouch is false, do not clear the focus even if user touch the screen.
+ if( (( touch.GetPointCount() < 1 ) || ( touch.GetState( 0 ) == PointState::DOWN )) && mClearFocusOnTouch )
bool mIsWaitingKeyboardFocusChangeCommit:1; /// A flag to indicate PreFocusChangeSignal emitted but the proposed focus actor is not commited by the application yet.
bool mIsWaitingKeyboardFocusChangeCommit:1; /// A flag to indicate PreFocusChangeSignal emitted but the proposed focus actor is not commited by the application yet.
+ bool mClearFocusOnTouch:1; ///< Whether clear focus on touch.
+
FocusStack mFocusHistory; ///< Stack to contain pre-focused actor's BaseObject*
SlotDelegate< KeyboardFocusManager > mSlotDelegate;
FocusStack mFocusHistory; ///< Stack to contain pre-focused actor's BaseObject*
SlotDelegate< KeyboardFocusManager > mSlotDelegate;