Bug fix when creating background of control using ImageActor 41/42541/4
authorFerran Sole <ferran.sole@samsung.com>
Mon, 29 Jun 2015 16:35:41 +0000 (17:35 +0100)
committerFerran Sole <ferran.sole@samsung.com>
Wed, 1 Jul 2015 14:37:46 +0000 (15:37 +0100)
Sort modifer was not beeing setted properly when background was created

Needs patch
"Added api to check actor's depth in the hierarchy" https://review.tizen.org/gerrit/#/c/42539/

Change-Id: Ia0ace26a620a78727bfe8976a5ceb96d318b940c

12 files changed:
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h

index 79668ff..7b0ca45 100644 (file)
@@ -122,7 +122,7 @@ void DummyControlImplOverride::OnPinch(const PinchGesture& pinch) { pinchCalled
 void DummyControlImplOverride::OnPan(const PanGesture& pan) { panCalled = true; }
 void DummyControlImplOverride::OnTap(const TapGesture& tap) { tapCalled = true; }
 void DummyControlImplOverride::OnLongPress(const LongPressGesture& longPress) { longPressCalled = true; }
 void DummyControlImplOverride::OnPan(const PanGesture& pan) { panCalled = true; }
 void DummyControlImplOverride::OnTap(const TapGesture& tap) { tapCalled = true; }
 void DummyControlImplOverride::OnLongPress(const LongPressGesture& longPress) { longPressCalled = true; }
-void DummyControlImplOverride::OnStageConnection( unsigned int depth ) { stageConnectionCalled = true; }
+void DummyControlImplOverride::OnStageConnection( int depth ) { stageConnectionCalled = true; }
 void DummyControlImplOverride::OnStageDisconnection() { stageDisconnectionCalled = true; }
 void DummyControlImplOverride::OnChildAdd(Actor& child) { childAddCalled = true; }
 void DummyControlImplOverride::OnChildRemove(Actor& child) { childRemoveCalled = true; }
 void DummyControlImplOverride::OnStageDisconnection() { stageDisconnectionCalled = true; }
 void DummyControlImplOverride::OnChildAdd(Actor& child) { childAddCalled = true; }
 void DummyControlImplOverride::OnChildRemove(Actor& child) { childRemoveCalled = true; }
index 6db3f8b..0538199 100644 (file)
@@ -111,7 +111,7 @@ private: // From Internal::Control
 
 private: // From CustomActorImpl
 
 
 private: // From CustomActorImpl
 
-  virtual void OnStageConnection( unsigned int depth );
+  virtual void OnStageConnection( int depth );
   virtual void OnStageDisconnection();
   virtual void OnChildAdd(Actor& child);
   virtual void OnChildRemove(Actor& child);
   virtual void OnStageDisconnection();
   virtual void OnChildAdd(Actor& child);
   virtual void OnChildRemove(Actor& child);
index 3f0059e..5490797 100644 (file)
@@ -425,7 +425,7 @@ void PageTurnView::SetupShadowView()
   mShadowView.Activate();
 }
 
   mShadowView.Activate();
 }
 
-void PageTurnView::OnStageConnection( unsigned int depth )
+void PageTurnView::OnStageConnection( int depth )
 {
   SetupShadowView();
   mTurningPageLayer.RaiseToTop();
 {
   SetupShadowView();
   mTurningPageLayer.RaiseToTop();
index 8ef6148..0bd7e8a 100644 (file)
@@ -198,7 +198,7 @@ private: // from Control
   /**
    * @copydoc CustomActorImpl::OnStageConnection()
    */
   /**
    * @copydoc CustomActorImpl::OnStageConnection()
    */
-  virtual void OnStageConnection( unsigned int depth );
+  virtual void OnStageConnection( int depth );
 
   /**
    * @copydoc CustomActorImpl::OnStageDisconnection()
 
   /**
    * @copydoc CustomActorImpl::OnStageDisconnection()
index a9714d4..d398a26 100644 (file)
@@ -657,7 +657,7 @@ void ScrollView::OnInitialize()
   SetInternalConstraints();
 }
 
   SetInternalConstraints();
 }
 
-void ScrollView::OnStageConnection( unsigned int depth )
+void ScrollView::OnStageConnection( int depth )
 {
   DALI_LOG_SCROLL_STATE("[0x%X]", this);
 
 {
   DALI_LOG_SCROLL_STATE("[0x%X]", this);
 
index ca7106e..bbd87bc 100644 (file)
@@ -549,7 +549,7 @@ private: // private overriden functions from CustomActorImpl and Controls
   /**
    * @copydoc CustomActorImpl::OnStageConnection()
    */
   /**
    * @copydoc CustomActorImpl::OnStageConnection()
    */
-  virtual void OnStageConnection( unsigned int depth );
+  virtual void OnStageConnection( int depth );
 
   /**
    * @copydoc CustomActorImpl::OnStageDisconnection()
 
   /**
    * @copydoc CustomActorImpl::OnStageDisconnection()
index fbe2fd5..c5e51eb 100644 (file)
@@ -1181,7 +1181,7 @@ void TextField::KeyboardStatusChanged(bool keyboardShown)
   }
 }
 
   }
 }
 
-void TextField::OnStageConnection( unsigned int depth )
+void TextField::OnStageConnection( int depth )
 {
   mDepth = depth;
 }
 {
   mDepth = depth;
 }
index eb35b4f..ed2fc4b 100644 (file)
@@ -142,7 +142,7 @@ private: // From Control
   /**
    * @copydoc Control::OnStageConnection()
    */
   /**
    * @copydoc Control::OnStageConnection()
    */
-  virtual void OnStageConnection( unsigned int depth );
+  virtual void OnStageConnection( int depth );
 
   /**
    * @copydoc Dali::CustomActorImpl::OnKeyEvent(const KeyEvent&)
 
   /**
    * @copydoc Dali::CustomActorImpl::OnKeyEvent(const KeyEvent&)
index 4bbadfb..065d0f9 100644 (file)
@@ -529,7 +529,7 @@ void TextLabel::AddDecoration( Actor& actor, bool needsClipping )
   // TextLabel does not show decorations
 }
 
   // TextLabel does not show decorations
 }
 
-void TextLabel::OnStageConnection( unsigned int depth )
+void TextLabel::OnStageConnection( int depth )
 {
   mDepth = depth;
 }
 {
   mDepth = depth;
 }
index 0984475..c099bdf 100644 (file)
@@ -100,7 +100,7 @@ private: // From Control
   /**
    * @copydoc Control::OnStageConnection()
    */
   /**
    * @copydoc Control::OnStageConnection()
    */
-  virtual void OnStageConnection( unsigned int depth );
+  virtual void OnStageConnection( int depth );
 
   /**
    * @copydoc Text::ControlInterface::RequestTextRelayout()
 
   /**
    * @copydoc Text::ControlInterface::RequestTextRelayout()
index 271a5ce..2274995 100644 (file)
@@ -253,7 +253,7 @@ Actor CreateBackground( Actor parent, const Vector4& color, Image image = Image(
 
     //Create the renderer
     Renderer renderer = Renderer::New( mesh, material );
 
     //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();
 
     //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.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;
   }
 
     return imageActor;
   }
@@ -949,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 )
 {
   unsigned int controlRendererCount = Self().GetRendererCount();
   for( unsigned int i(0); i<controlRendererCount; ++i )
index 1c3c35d..1ce94b7 100644 (file)
@@ -273,7 +273,7 @@ protected: // From CustomActorImpl, not to be used by application developers
   /**
    * @copydoc CustomActorImpl::OnStageConnection()
    */
   /**
    * @copydoc CustomActorImpl::OnStageConnection()
    */
-  virtual void OnStageConnection( unsigned int depth );
+  virtual void OnStageConnection( int depth );
 
   /**
    * @copydoc CustomActorImpl::OnStageDisconnection()
 
   /**
    * @copydoc CustomActorImpl::OnStageDisconnection()