Fix Kloc issues.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-label-impl.cpp
index f946cf2..fd0bcae 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>
@@ -147,10 +148,8 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr
         {
           const std::string fontFamily = value.Get< std::string >();
 
-          if( impl.mController->GetDefaultFontFamily() != fontFamily )
-          {
-            impl.mController->SetDefaultFontFamily( fontFamily, true );
-          }
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::SetProperty Property::FONT_FAMILY newFont(%s)\n", fontFamily.c_str() );
+          impl.mController->SetDefaultFontFamily( fontFamily );
         }
         break;
       }
@@ -283,7 +282,7 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr
         if( impl.mController )
         {
           float height = value.Get< float >();
-          if ( impl.mController->GetUnderlineHeight() != height )
+          if( fabsf( impl.mController->GetUnderlineHeight() - height ) > Math::MACHINE_EPSILON_1000 )
           {
             impl.mController->SetUnderlineHeight( height );
             impl.mRenderer.Reset();
@@ -444,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 );
 }
 
@@ -457,9 +459,9 @@ void TextLabel::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::
   {
     case StyleChange::DEFAULT_FONT_CHANGE:
     {
-      DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnStyleChange StyleChange::DEFAULT_FONT_CHANGE\n");
       // Property system did not set the font so should update it.
       std::string newFont = styleManager.GetDefaultFontFamily();
+      DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnStyleChange StyleChange::DEFAULT_FONT_CHANGE newFont(%s)\n", newFont.c_str() );
       mController->UpdateAfterFontChange( newFont );
       break;
     }
@@ -517,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 )