X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fstyling%2Fstyle-manager-impl.cpp;h=0e43c192ce4a182111a3ef6b2cc91c4926b8937a;hp=acf1ced9afd409f725573e9d196413d70e4abc8f;hb=467273430b68ef02ca30677af8dbb64277e5a668;hpb=066856d5c4c7a8bacd33f9a3ed49018e8dc41c4f diff --git a/base/dali-toolkit/internal/styling/style-manager-impl.cpp b/base/dali-toolkit/internal/styling/style-manager-impl.cpp index acf1ced..0e43c19 100644 --- a/base/dali-toolkit/internal/styling/style-manager-impl.cpp +++ b/base/dali-toolkit/internal/styling/style-manager-impl.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include // EXTERNAL INCLUDES @@ -108,8 +107,7 @@ Toolkit::StyleManager StyleManager::Get() } StyleManager::StyleManager() - : mOrientationDegrees( 0 ), // Portrait - mSetThemeConnection( false ) + : mOrientationDegrees( 0 ) // Portrait { // Add theme builder constants mThemeBuilderConstants[ PACKAGE_PATH_KEY ] = DEFAULT_PACKAGE_PATH; @@ -125,16 +123,17 @@ StyleManager::StyleManager() StyleManager::~StyleManager() { - // Disconnect from signal - SetOrientation( Orientation() ); } void StyleManager::SetOrientationValue( int orientation ) { - mOrientationDegrees = orientation; - - Util::ConnectEventProcessingFinishedSignal(); - mSetThemeConnection = true; + if( orientation != mOrientationDegrees ) + { + mOrientationDegrees = orientation; + // TODO: if orientation changed, apply the new style to all controls + // dont want to really do the whole load from file again if the bundle contains both portrait & landscape + SetTheme(); + } } int StyleManager::GetOrientationValue() @@ -182,12 +181,9 @@ bool StyleManager::GetStyleConstant( const std::string& key, Property::Value& va void StyleManager::OnOrientationChanged( Orientation orientation ) { mOrientation = orientation; - - if( mOrientation ) - { - Util::ConnectEventProcessingFinishedSignal(); - mSetThemeConnection = true; - } + // TODO: if orientation changed, apply the new style to all controls + // dont want to really do the whole load from file again if the bundle contains both portrait & landscape + SetTheme(); } Toolkit::Builder StyleManager::CreateBuilder( const PropertyValueMap& constants ) @@ -350,8 +346,8 @@ void StyleManager::RequestThemeChange( const std::string& themeFile ) { mThemeFile = themeFile; - Util::ConnectEventProcessingFinishedSignal(); - mSetThemeConnection = true; + // need to do style change synchronously as app might create a UI control on the next line + SetTheme(); } void StyleManager::RequestDefaultTheme() @@ -359,18 +355,11 @@ void StyleManager::RequestDefaultTheme() RequestThemeChange( DEFAULT_THEME ); } -bool StyleManager::IsThemeRequestPending() -{ - return mSetThemeConnection; -} - void StyleManager::SetTheme() { mThemeBuilder = CreateBuilder( mThemeBuilderConstants ); LoadJSON( mThemeBuilder, mThemeFile ); - mSetThemeConnection = false; - StyleChange change; change.themeChange = true; mStyleChangeSignal.Emit( Toolkit::StyleManager::Get(), change );