From fa3449165ecd68eeca9f07ca6abf0b56f3477d9e Mon Sep 17 00:00:00 2001 From: Agnelo Vaz Date: Fri, 28 Aug 2015 16:04:58 +0100 Subject: [PATCH] TextLabel to update font when system font changes * If font not set through Property system then changing the system font updates the label's font Signed-off-by: Agnelo Vaz Change-Id: If3fa2ddda8fcbc1b5570586fbfd4335c9f577914 --- dali-toolkit/internal/controls/text-controls/text-label-impl.cpp | 8 +++----- dali-toolkit/internal/text/text-controller-impl.h | 1 - dali-toolkit/internal/text/text-controller.cpp | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp index 0857852..f946cf2 100644 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -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; } diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h index 65fce8e..0efe8c1 100644 --- a/dali-toolkit/internal/text/text-controller-impl.h +++ b/dali-toolkit/internal/text/text-controller-impl.h @@ -21,7 +21,6 @@ // EXTERNAL INCLUDES #include #include -#include // INTERNAL INCLUDES #include diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 822a62f..a0302bc 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -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 -- 2.7.4