Actor renderableActor;
if( mRenderer )
{
- renderableActor = mRenderer->Render( mController->GetView() );
+ renderableActor = mRenderer->Render( mController->GetView(), mDepth );
}
EnableClipping( (Dali::Toolkit::TextField::EXCEED_POLICY_CLIP == mExceedPolicy), size );
}
}
+void TextField::OnStageConnection( unsigned int depth )
+{
+ mDepth = depth;
+}
+
bool TextField::OnTouched( Actor actor, const TouchEvent& event )
{
return true;
TextField::TextField()
: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
mRenderingBackend( DEFAULT_RENDERING_BACKEND ),
- mExceedPolicy( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP )
+ mExceedPolicy( Dali::Toolkit::TextField::EXCEED_POLICY_CLIP ),
+ mDepth( 0 )
{
}
virtual void OnPan( const PanGesture& gesture );
/**
+ * @copydoc Control::OnStageConnection()
+ */
+ virtual void OnStageConnection( unsigned int depth );
+
+ /**
* @copydoc Dali::CustomActorImpl::OnKeyEvent(const KeyEvent&)
*/
virtual bool OnKeyEvent(const KeyEvent& event);
int mRenderingBackend;
int mExceedPolicy;
+ unsigned int mDepth;
};
} // namespace Internal
Actor renderableActor;
if( mRenderer )
{
- renderableActor = mRenderer->Render( mController->GetView() );
+ renderableActor = mRenderer->Render( mController->GetView(), mDepth );
}
if( renderableActor != mRenderableActor )
RelayoutRequest();
}
+void TextLabel::OnStageConnection( unsigned int depth )
+{
+ mDepth = depth;
+}
+
void TextLabel::TextChanged()
{
// TextLabel does not provide a signal for this
TextLabel::TextLabel()
: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
- mRenderingBackend( DEFAULT_RENDERING_BACKEND )
+ mRenderingBackend( DEFAULT_RENDERING_BACKEND ),
+ mDepth( 0 )
{
}
virtual float GetHeightForWidth( float width );
/**
+ * @copydoc Control::OnStageConnection()
+ */
+ virtual void OnStageConnection( unsigned int depth );
+
+ /**
* @copydoc Text::ControlInterface::RequestTextRelayout()
*/
virtual void RequestTextRelayout();
Text::ControllerPtr mController;
Text::RendererPtr mRenderer;
Actor mRenderableActor;
-
int mRenderingBackend;
+ unsigned int mDepth;
};
} // namespace Internal
#include <dali/devel-api/rendering/shader.h>
#include <dali/devel-api/text-abstraction/font-client.h>
#include <dali/integration-api/debug.h>
-
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-depth-index-ranges.h>
#include <dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h>
const Vector4& shadowColor,
bool underlineEnabled,
const Vector4& underlineColor,
- float underlineHeight )
+ float underlineHeight,
+ unsigned int depth )
{
AtlasManager::AtlasSlot slot;
std::vector< MeshRecord > meshContainer;
Vector< Extent > extents;
+ mDepth = static_cast< int >( depth );
float currentUnderlinePosition = ZERO;
float currentUnderlineThickness = underlineHeight;
Material material = mGlyphManager.GetMaterial( meshRecord.mAtlasId );
Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, material );
+ renderer.SetDepthIndex( mDepth );
Actor actor = Actor::New();
actor.AddRenderer( renderer );
actor.SetSize( 1.0f, 1.0f );
Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, material );
// Ensure shadow is behind the text...
- renderer.SetDepthIndex( CONTENT_DEPTH_INDEX - 1 );
+ renderer.SetDepthIndex( mDepth + CONTENT_DEPTH_INDEX - 1 );
Actor actor = Actor::New();
actor.AddRenderer( renderer );
actor.SetSize( 1.0f, 1.0f );
std::vector< uint32_t > mFace; ///> Face indices for a quad
Property::Map mQuadVertexFormat;
Property::Map mQuadIndexFormat;
+ int mDepth;
};
Text::RendererPtr AtlasRenderer::New()
return Text::RendererPtr( new AtlasRenderer() );
}
-Actor AtlasRenderer::Render( Text::ViewInterface& view )
+Actor AtlasRenderer::Render( Text::ViewInterface& view, unsigned int depth )
{
UnparentAndReset( mImpl->mActor );
view.GetShadowColor(),
view.IsUnderlineEnabled(),
view.GetUnderlineColor(),
- view.GetUnderlineHeight() );
+ view.GetUnderlineHeight(),
+ depth );
}
return mImpl->mActor;
* @brief Render the glyphs from a ViewInterface.
*
* @param[in] view The interface to a view.
+ * @param[in] depth The depth in the tree of the parent.
* @return The Renderable actor used to position the text.
*/
- virtual Actor Render( ViewInterface& view );
+ virtual Actor Render( ViewInterface& view, unsigned int depth );
protected:
return Text::RendererPtr( new BasicRenderer() );
}
-Actor BasicRenderer::Render( Text::ViewInterface& view )
+Actor BasicRenderer::Render( Text::ViewInterface& view, unsigned int depth )
{
// Remove the previous text
UnparentAndReset( mImpl->mActor );
* @brief Render the glyphs from a ViewInterface.
*
* @param[in] view The interface to a view.
+ * @param[in] depth The tree depth of the parent.
+ * .
* @return The Renderable actor used to position the text.
*/
- virtual Actor Render( ViewInterface& view );
+ virtual Actor Render( ViewInterface& view, unsigned int depth );
protected:
* @brief Render the glyphs from a ViewInterface.
*
* @param[in] view The interface to a view.
+ * @param[in] depth The depth in the tree of the parent.
* @return The Renderable actor used to position the text.
*/
- virtual Actor Render( ViewInterface& view ) = 0;
+ virtual Actor Render( ViewInterface& view, unsigned int depth ) = 0;
protected: