X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fstyling%2Fstyle-manager-impl.cpp;h=a5a02dd10cc212c11ccfc5494a2da3c49d09fab8;hp=066d812a0df56565a12698e28fe4a2538d4dba45;hb=610495b8647d1a25c98bf0773ccc0dd6d1996263;hpb=8fa20ba95882b3330c24f333b9aca261f9284322 diff --git a/dali-toolkit/internal/styling/style-manager-impl.cpp b/dali-toolkit/internal/styling/style-manager-impl.cpp index 066d812..a5a02dd 100644 --- a/dali-toolkit/internal/styling/style-manager-impl.cpp +++ b/dali-toolkit/internal/styling/style-manager-impl.cpp @@ -25,6 +25,7 @@ #include // INTERNAL INCLUDES +#include #include #include #include @@ -38,12 +39,12 @@ namespace const char* PORTRAIT_QUALIFIER = "portrait"; const char* FONT_SIZE_QUALIFIER = "fontsize"; -const char* DEFAULT_THEME = DALI_STYLE_DIR "dali-toolkit-default-theme.json"; +const char* DEFAULT_THEME_FILE_NAME = "dali-toolkit-default-theme.json"; const char* PACKAGE_PATH_KEY = "PACKAGE_PATH"; const char* APPLICATION_RESOURCE_PATH_KEY = "APPLICATION_RESOURCE_PATH"; -const char* DEFAULT_PACKAGE_PATH = DALI_DATA_READ_ONLY_DIR "/toolkit/"; +const char* DEFAULT_TOOLKIT_PACKAGE_PATH = "/toolkit/"; #if defined(DEBUG_ENABLED) Debug::Filter* gLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_STYLE"); @@ -108,10 +109,12 @@ Toolkit::StyleManager StyleManager::Get() StyleManager::StyleManager() : mDefaultFontSize( -1 ), mDefaultFontFamily(""), - mFeedbackStyle( NULL ) + mDefaultThemeFilePath(), + mFeedbackStyle( nullptr ) { // Add theme builder constants - mThemeBuilderConstants[ PACKAGE_PATH_KEY ] = DEFAULT_PACKAGE_PATH; + const std::string dataReadOnlyDir = AssetManager::GetDaliDataReadOnlyPath(); + mThemeBuilderConstants[ PACKAGE_PATH_KEY ] = dataReadOnlyDir + DEFAULT_TOOLKIT_PACKAGE_PATH; mThemeBuilderConstants[ APPLICATION_RESOURCE_PATH_KEY ] = Application::GetResourcePath(); mStyleMonitor = StyleMonitor::Get(); @@ -121,6 +124,10 @@ StyleManager::StyleManager() mDefaultFontSize = mStyleMonitor.GetDefaultFontSize(); } + // Set the full path for the default style theme. + const std::string styleDirPath = AssetManager::GetDaliStylePath(); + mDefaultThemeFilePath = styleDirPath + DEFAULT_THEME_FILE_NAME; + // Sound & haptic style mFeedbackStyle = new FeedbackStyle(); } @@ -137,7 +144,7 @@ void StyleManager::ApplyTheme( const std::string& themeFile ) void StyleManager::ApplyDefaultTheme() { - SetTheme( DEFAULT_THEME ); + SetTheme(mDefaultThemeFilePath); } const std::string& StyleManager::GetDefaultFontFamily() const @@ -240,10 +247,10 @@ void StyleManager::SetTheme( const std::string& themeFile ) { loading = true; mThemeBuilder = CreateBuilder( mThemeBuilderConstants ); - themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME ); // Sets themeLoaded to true if theme exists + themeLoaded = LoadJSON( mThemeBuilder, mDefaultThemeFilePath ); // Sets themeLoaded to true if theme exists } - if( themeFile.compare(DEFAULT_THEME) != 0 ) + if( themeFile.compare(mDefaultThemeFilePath) != 0 ) { // The theme is different to the default: Merge it loading = true; @@ -291,8 +298,8 @@ const Property::Map StyleManager::GetConfigurations() mThemeBuilder = CreateBuilder( mThemeBuilderConstants ); // Load default theme because this is first try to load stylesheet. - themeLoaded = LoadJSON( mThemeBuilder, DEFAULT_THEME ); - mThemeFile = DEFAULT_THEME; + themeLoaded = LoadJSON( mThemeBuilder, mDefaultThemeFilePath ); + mThemeFile = mDefaultThemeFilePath; if( themeLoaded ) {