Fix text and control depth indices to have sane values
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-label-impl.cpp
index 1c31449..12de684 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/public-api/text/rendering-backend.h>
 #include <dali-toolkit/internal/controls/text-controls/text-font-style.h>
 #include <dali-toolkit/internal/text/rendering/text-backend.h>
@@ -148,10 +149,7 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr
           const std::string fontFamily = value.Get< std::string >();
 
           DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::SetProperty Property::FONT_FAMILY newFont(%s)\n", fontFamily.c_str() );
-          if( impl.mController->GetDefaultFontFamily() != fontFamily )
-          {
-            impl.mController->SetDefaultFontFamily( fontFamily, true );
-          }
+          impl.mController->SetDefaultFontFamily( fontFamily );
         }
         break;
       }
@@ -445,7 +443,10 @@ void TextLabel::OnInitialize()
 
   // Enable the text ellipsis.
   LayoutEngine& engine = mController->GetLayoutEngine();
+
   engine.SetTextEllipsisEnabled( true );
+  engine.SetCursorWidth( 0u ); // Do not layout space for the cursor.
+
   self.OnStageSignal().Connect( this, &TextLabel::OnStageConnect );
 }
 
@@ -518,7 +519,7 @@ void TextLabel::RenderText()
   Actor renderableActor;
   if( mRenderer )
   {
-    renderableActor = mRenderer->Render( mController->GetView(), self.GetHierarchyDepth() );
+    renderableActor = mRenderer->Render( mController->GetView(), TEXT_DEPTH_INDEX );
   }
 
   if( renderableActor != mRenderableActor )