X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-label-impl.cpp;h=81a5c97394fdc581ba966ab356421733b6185829;hp=aff8134241889d8a1919fdb6a0a5b932e7dbc10f;hb=8cdf22c87a0428691dcf7df10f3020656b3a2ebf;hpb=d15b9def82b922ae3013ea250e4f6fe260417a79 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 aff8134..81a5c97 100644 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include using Dali::Toolkit::Text::LayoutEngine; @@ -50,6 +51,10 @@ namespace namespace { +#if defined(DEBUG_ENABLED) + Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_CONTROLS"); +#endif + const Scripting::StringEnum HORIZONTAL_ALIGNMENT_STRING_TABLE[] = { { "BEGIN", Toolkit::Text::LayoutEngine::HORIZONTAL_ALIGN_BEGIN }, @@ -458,7 +463,39 @@ void TextLabel::OnInitialize() void TextLabel::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change ) { - GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) ); + + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextLabel::OnStyleChange\n"); + + switch ( change ) + { + 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 + } + break; + } + + case StyleChange::DEFAULT_FONT_SIZE_CHANGE: + { + DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnStyleChange StyleChange::DEFAULT_FONT_SIZE_CHANGE (%f)\n", mController->GetDefaultPointSize() ); + + if ( (mController->GetDefaultPointSize() <= 0.0f) ) // If DefaultPointSize not set by Property system it will be 0.0f + { + // Property system did not set the PointSize so should update it. + // todo instruct text-controller to update model + } + break; + } + case StyleChange::THEME_CHANGE: + { + GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) ); + break; + } + } } Vector3 TextLabel::GetNaturalSize()