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 08578526044050d707ea51a214fab23e2194be14..f946cf25b7ea8965335332df295178ed99464013 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 65fce8ed4b20a48e96941c7f419815eeb1767840..0efe8c1ff4d2b4cbcf86f6fae8662dfc83e8d197 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 822a62f7f076611ac36b3076a520e96f57a210e3..a0302bc3e25d211d0cbb060722c2c21fefbbc532 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