Bug fix when creating background of control using ImageActor
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / controls / control-impl.cpp
index bbc98b4..2274995 100644 (file)
@@ -64,12 +64,12 @@ BaseHandle Create()
  * @param[in] attributes The attributes with which to perfrom this action.
  * @return true if action has been accepted by this control
  */
-const char* ACTION_CONTROL_ACTIVATED = "control-activated";
+const char* ACTION_ACCESSIBILITY_ACTIVATED = "accessibility-activated";
 static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes )
 {
   bool ret = false;
 
-  if( object && ( 0 == strcmp( actionName.c_str(), ACTION_CONTROL_ACTIVATED ) ) )
+  if( object && ( 0 == strcmp( actionName.c_str(), ACTION_ACCESSIBILITY_ACTIVATED ) ) )
   {
     Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
     if( control )
@@ -158,7 +158,7 @@ SignalConnectorType registerSignal5( typeRegistration, SIGNAL_PANNED, &DoConnect
 SignalConnectorType registerSignal6( typeRegistration, SIGNAL_PINCHED, &DoConnectSignal );
 SignalConnectorType registerSignal7( typeRegistration, SIGNAL_LONG_PRESSED, &DoConnectSignal );
 
-TypeAction registerAction( typeRegistration, ACTION_CONTROL_ACTIVATED, &DoAction );
+TypeAction registerAction( typeRegistration, ACTION_ACCESSIBILITY_ACTIVATED, &DoAction );
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -253,7 +253,7 @@ Actor CreateBackground( Actor parent, const Vector4& color, Image image = Image(
 
     //Create the renderer
     Renderer renderer = Renderer::New( mesh, material );
-    renderer.SetDepthIndex( BACKGROUND_DEPTH_INDEX );
+    renderer.SetDepthIndex( parent.GetHierarchyDepth() + BACKGROUND_DEPTH_INDEX );
 
     //Create the actor
     Actor meshActor = Actor::New();
@@ -278,6 +278,7 @@ Actor CreateBackground( Actor parent, const Vector4& color, Image image = Image(
     imageActor.SetPositionInheritanceMode( USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
     imageActor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
     imageActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+    imageActor.SetSortModifier( parent.GetHierarchyDepth() + BACKGROUND_DEPTH_INDEX );
 
     return imageActor;
   }
@@ -767,11 +768,22 @@ void Control::AccessibilityActivate()
   OnAccessibilityActivated();
 }
 
+void Control::KeyboardEnter()
+{
+  // Inform deriving classes
+  OnKeyboardEnter();
+}
+
 bool Control::OnAccessibilityActivated()
 {
   return false; // Accessibility activation is not handled by default
 }
 
+bool Control::OnKeyboardEnter()
+{
+  return false; // Keyboard enter is not handled by default
+}
+
 bool Control::OnAccessibilityPan(PanGesture gesture)
 {
   return false; // Accessibility pan gesture is not handled by default
@@ -938,7 +950,7 @@ void Control::EmitKeyInputFocusSignal( bool focusGained )
   }
 }
 
-void Control::OnStageConnection( unsigned int depth )
+void Control::OnStageConnection( int depth )
 {
   unsigned int controlRendererCount = Self().GetRendererCount();
   for( unsigned int i(0); i<controlRendererCount; ++i )