X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ffocus-manager%2Fkeyboard-focus-manager-impl.cpp;h=21a03493c222c13875f227c6fd03e8a84bb05eab;hp=f67ca6fd297585a58d36cabe395fa430d3a7e664;hb=9dc9e248aa53b097c6a41fb043c3d5341f93ec45;hpb=c00b54ce005b74dfbf5397468d4dca1e4dfbbf31 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 f67ca6f..21a0349 100644 --- a/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp @@ -38,6 +38,7 @@ #include #include #include +#include namespace Dali { @@ -152,15 +153,24 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor( const unsigned int actorID ) // Check whether the actor is in the stage and is keyboard focusable. if( actor && actor.IsKeyboardFocusable() ) { - // Draw the focus indicator upon the focused actor when Focus Indicator is enabled if( mIsFocusIndicatorEnabled ) { actor.Add( GetFocusIndicatorActor() ); } // Send notification for the change of focus actor + Actor currentFocusedActor = GetCurrentFocusActor(); + if( !mFocusChangedSignal.Empty() ) { - mFocusChangedSignal.Emit(GetCurrentFocusActor(), actor); + mFocusChangedSignal.Emit(currentFocusedActor, actor); + } + + Toolkit::Control currentlyFocusedControl = Toolkit::Control::DownCast(currentFocusedActor); + if( currentlyFocusedControl ) + { + // Do we need it to remember if it was previously DISABLED? + currentlyFocusedControl.SetProperty(DevelControl::Property::STATE, DevelControl::NORMAL ); + currentlyFocusedControl.ClearKeyInputFocus(); } DALI_LOG_INFO( gLogFilter, Debug::General, "[%s:%d] Focus Changed\n", __FUNCTION__, __LINE__); @@ -168,6 +178,13 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor( const unsigned int actorID ) // Save the current focused actor mCurrentFocusActor = actorID; + Toolkit::Control newlyFocusedControl = Toolkit::Control::DownCast(actor); + if( newlyFocusedControl ) + { + newlyFocusedControl.SetProperty(DevelControl::Property::STATE, DevelControl::FOCUSED ); + newlyFocusedControl.SetKeyInputFocus(); + } + // Push Current Focused Actor to FocusHistory mFocusHistory.PushBack( &actor.GetBaseObject() ); @@ -400,17 +417,24 @@ void KeyboardFocusManager::DoKeyboardEnter(Actor actor) void KeyboardFocusManager::ClearFocus() { Actor actor = GetCurrentFocusActor(); - if(actor) + if( actor ) { - if(mFocusIndicatorActor) + if( mFocusIndicatorActor ) { - actor.Remove(mFocusIndicatorActor); + actor.Remove( mFocusIndicatorActor ); } // Send notification for the change of focus actor if( !mFocusChangedSignal.Empty() ) { - mFocusChangedSignal.Emit(actor, Actor()); + mFocusChangedSignal.Emit( actor, Actor() ); + } + + Toolkit::Control currentlyFocusedControl = Toolkit::Control::DownCast( actor ); + if( currentlyFocusedControl ) + { + currentlyFocusedControl.SetProperty( DevelControl::Property::STATE, DevelControl::NORMAL ); + currentlyFocusedControl.ClearKeyInputFocus(); } }