#include <dali/integration-api/adaptor-framework/scene-holder.h>
// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
const char* const IS_FOCUS_GROUP_PROPERTY_NAME = "isKeyboardFocusGroup"; // This property will be replaced by a flag in Control.
-const char* const FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "keyboard_focus.9.png";
+const char* const FOCUS_BORDER_IMAGE_FILE_NAME = "keyboard_focus.9.png";
BaseHandle Create()
{
bool KeyboardFocusManager::DoSetCurrentFocusActor( Actor actor )
{
bool success = false;
- if( actor && actor.IsKeyboardFocusable() && actor.OnStage() )
+ if( actor && actor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) && actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) )
{
Integration::SceneHolder currentWindow = Integration::SceneHolder::Get( actor );
}
// Check whether the actor is in the stage and is keyboard focusable.
- if( actor && actor.IsKeyboardFocusable() && actor.OnStage() )
+ if( actor && actor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) && actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) )
{
if( ( mIsFocusIndicatorShown == SHOW ) && ( mEnableFocusIndicator == ENABLE ) )
{
{
Actor actor = mCurrentFocusActor.GetHandle();
- if( actor && ! actor.OnStage() )
+ if( actor && ! actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) )
{
// If the actor has been removed from the stage, then it should not be focused
actor.Reset();
}
}
- if( actor && ! actor.OnStage() )
+ if( actor && ! actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) )
{
// If the actor has been removed from the window, then the window doesn't have any focused actor
actor.Reset();
Actor target = mFocusHistory[ mFocusHistory.size() -1 ].GetHandle();
// Impl of Actor is not null
- if( target && target.OnStage() )
+ if( target && target.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) )
{
// Delete pre focused actor in history because it will pushed again by SetCurrentFocusActor()
mFocusHistory.pop_back();
}
}
- if( nextFocusableActor && nextFocusableActor.IsKeyboardFocusable() )
+ if( nextFocusableActor && nextFocusableActor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) )
{
// Whether the next focusable actor is a layout control
if( IsLayoutControl( nextFocusableActor ) )
Actor nextFocusableActor = GetImplementation( control ).GetNextKeyboardFocusableActor(actor, direction, mFocusGroupLoopEnabled);
if(nextFocusableActor)
{
- if(!nextFocusableActor.IsKeyboardFocusable())
+ if(!nextFocusableActor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ))
{
// If the actor is not focusable, ask the same layout control for the next actor to focus
return DoMoveFocusWithinLayoutControl(control, nextFocusableActor, direction);
mIsWaitingKeyboardFocusChangeCommit = false;
}
- if (committedFocusActor && committedFocusActor.IsKeyboardFocusable())
+ if (committedFocusActor && committedFocusActor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ))
{
// Whether the commited focusable actor is a layout control
if(IsLayoutControl(committedFocusActor))
if( ! mFocusIndicatorActor )
{
// Create the default if it hasn't been set and one that's shared by all the keyboard focusable actors
- mFocusIndicatorActor = Toolkit::ImageView::New( FOCUS_BORDER_IMAGE_PATH );
+ const std::string imageDirPath = AssetManager::GetDaliImagePath();
+ mFocusIndicatorActor = Toolkit::ImageView::New( imageDirPath + FOCUS_BORDER_IMAGE_FILE_NAME );
// Apply size constraint to the focus indicator
mFocusIndicatorActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
}
- mFocusIndicatorActor.SetParentOrigin( ParentOrigin::CENTER );
- mFocusIndicatorActor.SetAnchorPoint( AnchorPoint::CENTER );
- mFocusIndicatorActor.SetPosition(0.0f, 0.0f);
+ mFocusIndicatorActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mFocusIndicatorActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mFocusIndicatorActor.SetProperty( Actor::Property::POSITION, Vector2(0.0f, 0.0f));
return mFocusIndicatorActor;
}