TextLabel to update font when system font changes 56/47056/3
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 28 Aug 2015 15:04:58 +0000 (16:04 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Thu, 3 Sep 2015 14:26:46 +0000 (15:26 +0100)
* If font not set through Property system then changing the system font updates the label's font

Signed-off-by: Agnelo Vaz <agnelo.vaz@samsung.com>
Change-Id: If3fa2ddda8fcbc1b5570586fbfd4335c9f577914

dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp

index 0857852..f946cf2 100644 (file)
@@ -458,11 +458,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");
-      if ( mController->GetDefaultFontFamily() == "" )
-      {
-        // Property system did not set the font so should update it.
-        // todo instruct text-controller to update model
-      }
+      // Property system did not set the font so should update it.
+      std::string newFont = styleManager.GetDefaultFontFamily();
+      mController->UpdateAfterFontChange( newFont );
       break;
     }
 
index 65fce8e..0efe8c1 100644 (file)
@@ -21,7 +21,6 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/clipboard.h>
 #include <dali/devel-api/text-abstraction/font-client.h>
-#include <iostream>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/layouts/layout-engine.h>
index 822a62f..a0302bc 100644 (file)
@@ -234,6 +234,7 @@ void Controller::SetDefaultFontFamily( const std::string& defaultFontFamily, boo
   }
 
   mImpl->mFontDefaults->mFontDescription.family = defaultFontFamily;
+  DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetDefaultFontFamily %s userDefined: %s\n", defaultFontFamily.c_str(), userDefined ? "true":"false" );
   mImpl->mUserDefinedFontFamily = userDefined;
 
   // Clear the font-specific data