X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ffocus-manager%2Fkeyboard-focus-manager-impl.cpp;h=a20808c90f92189f6fe5113ff20d57c121b78218;hb=496563cc996dfa3201f466aba3a0427b78f21d38;hp=3f398c58c3e4ee3f340b312338dd6c1280fe5413;hpb=6b708ec31364694c917a69faf8ffd6350f9e62fb;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git 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..a20808c 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -123,6 +123,7 @@ KeyboardFocusManager::KeyboardFocusManager() mFocusGroupLoopEnabled( false ), mIsWaitingKeyboardFocusChangeCommit( false ), mClearFocusOnTouch( true ), + mEnableFocusIndicator( true ), mFocusHistory(), mSlotDelegate( this ), mCustomAlgorithmInterface(NULL) @@ -178,7 +179,7 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor( Actor actor ) // Check whether the actor is in the stage and is keyboard focusable. if( actor && actor.IsKeyboardFocusable() && actor.OnStage() ) { - if( mIsFocusIndicatorEnabled ) + if( mIsFocusIndicatorEnabled && mEnableFocusIndicator ) { actor.Add( GetFocusIndicatorActor() ); } @@ -672,12 +673,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 +693,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 +712,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 +724,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 +736,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 +749,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; } @@ -851,8 +837,11 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event) Actor actor = GetCurrentFocusActor(); if( actor ) { - // Make sure the focused actor is highlighted - actor.Add( GetFocusIndicatorActor() ); + if( mEnableFocusIndicator ) + { + // Make sure the focused actor is highlighted + actor.Add( GetFocusIndicatorActor() ); + } } else { @@ -938,6 +927,21 @@ void KeyboardFocusManager::SetCustomAlgorithm(CustomAlgorithmInterface& interfac mCustomAlgorithmInterface = &interface; } +void KeyboardFocusManager::EnableFocusIndicator(bool enable) +{ + if( !enable && mFocusIndicatorActor ) + { + mFocusIndicatorActor.Unparent(); + } + + mEnableFocusIndicator = enable; +} + +bool KeyboardFocusManager::IsFocusIndicatorEnabled() const +{ + return mEnableFocusIndicator; +} + } // namespace Internal } // namespace Toolkit