From 69ae9248921d7d782050df556647a684cedc721d Mon Sep 17 00:00:00 2001 From: "minho.sun" Date: Mon, 22 Jan 2018 19:05:02 +0900 Subject: [PATCH] [4.0] add getter/setter for ignoreGlobalFontSizeChanged Add getter/setter for ignoreGlobalFontSizeChanged. And make watch-application always set this option to true. Change-Id: Iade9f6037c6230c2cdf8108f7896a7a6a7c60309 Signed-off-by: minho.sun --- adaptors/common/style-monitor-impl.cpp | 23 ++++++++++++++++------ adaptors/common/style-monitor-impl.h | 11 +++++++++++ .../devel-api/adaptor-framework/style-monitor.cpp | 10 ++++++++++ .../devel-api/adaptor-framework/style-monitor.h | 12 +++++++++++ adaptors/wearable/watch-application-impl.cpp | 2 ++ 5 files changed, 52 insertions(+), 6 deletions(-) diff --git a/adaptors/common/style-monitor-impl.cpp b/adaptors/common/style-monitor-impl.cpp index f85e0b1..a8cc2d8 100644 --- a/adaptors/common/style-monitor-impl.cpp +++ b/adaptors/common/style-monitor-impl.cpp @@ -86,7 +86,8 @@ Dali::StyleMonitor StyleMonitor::Get() } StyleMonitor::StyleMonitor() -: mDefaultFontSize(-1) +: mDefaultFontSize(-1), + mIgnoreGlobalFontSizeChange(-1) { mFontClient = TextAbstraction::FontClient::Get(); GetSystemDefaultFontFamily( mFontClient, mDefaultFontFamily ); @@ -171,11 +172,6 @@ bool StyleMonitor::LoadThemeFile( const std::string& filename, std::string& outp return retval; } -Dali::StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal() -{ - return mStyleChangeSignal; -} - void StyleMonitor::EmitStyleChangeSignal( StyleChange::Type styleChange ) { if( !mStyleChangeSignal.Empty() ) @@ -186,6 +182,21 @@ void StyleMonitor::EmitStyleChangeSignal( StyleChange::Type styleChange ) } } +int StyleMonitor::GetIgnoreGlobalFontSizeChange() +{ + return mIgnoreGlobalFontSizeChange; +} + +void StyleMonitor::SetIgnoreGlobalFontSizeChange(int value) +{ + mIgnoreGlobalFontSizeChange = value; +} + +Dali::StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal() +{ + return mStyleChangeSignal; +} + } // namespace Adaptor } // namespace Internal diff --git a/adaptors/common/style-monitor-impl.h b/adaptors/common/style-monitor-impl.h index 5fffbbe..8d2bf73 100644 --- a/adaptors/common/style-monitor-impl.h +++ b/adaptors/common/style-monitor-impl.h @@ -96,6 +96,16 @@ public: */ bool LoadThemeFile( const std::string& filename, std::string& output ); + /** + * @copydoc Dali::StyleMonitor::GetIgnoreGlobalFontSizeChange() + */ + int GetIgnoreGlobalFontSizeChange(); + + /** + * @copydoc Dali::StyleMonitor::SetIgnoreGlobalFontSizeChange() + */ + void SetIgnoreGlobalFontSizeChange(int value); + // Signals /** @@ -127,6 +137,7 @@ private: std::string mDefaultFontStyle; ///< The default font style std::string mUserDefinedThemeFilePath; ///< String containing the user defined theme file path int mDefaultFontSize; ///< The default accessibility font size e.g. 0 is smallest + int mIgnoreGlobalFontSizeChange; ///< Ignore global font size change when it is 1 }; } // namespace Adaptor diff --git a/adaptors/devel-api/adaptor-framework/style-monitor.cpp b/adaptors/devel-api/adaptor-framework/style-monitor.cpp index 4b08a2b..2e1e25a 100644 --- a/adaptors/devel-api/adaptor-framework/style-monitor.cpp +++ b/adaptors/devel-api/adaptor-framework/style-monitor.cpp @@ -77,6 +77,16 @@ bool StyleMonitor::LoadThemeFile( const std::string& filename, std::string& outp return GetImplementation(*this).LoadThemeFile( filename, output ); } +int StyleMonitor::GetIgnoreGlobalFontSizeChange() +{ + return GetImplementation(*this).GetIgnoreGlobalFontSizeChange(); +} + +void StyleMonitor::SetIgnoreGlobalFontSizeChange(int value) +{ + GetImplementation(*this).SetIgnoreGlobalFontSizeChange( value ); +} + StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal() { return GetImplementation(*this).StyleChangeSignal(); diff --git a/adaptors/devel-api/adaptor-framework/style-monitor.h b/adaptors/devel-api/adaptor-framework/style-monitor.h index bf63048..692fe73 100644 --- a/adaptors/devel-api/adaptor-framework/style-monitor.h +++ b/adaptors/devel-api/adaptor-framework/style-monitor.h @@ -142,6 +142,18 @@ public: // Style Information */ bool LoadThemeFile( const std::string& filename, std::string& output ); + /** + * Return the value of mIgnoreGlobalFontSizeChange. + * @return Return mIgnoreGlobalFontSizeChange. + */ + int GetIgnoreGlobalFontSizeChange(); + + /** + * Informs the Style Monitor that the style has changed. + * @param[in] value The value of mIgnoreGlobalFontSizeChange. + */ + void SetIgnoreGlobalFontSizeChange(int value); + public: // Signals /** diff --git a/adaptors/wearable/watch-application-impl.cpp b/adaptors/wearable/watch-application-impl.cpp index c0fc0e5..0c89bfc 100755 --- a/adaptors/wearable/watch-application-impl.cpp +++ b/adaptors/wearable/watch-application-impl.cpp @@ -17,6 +17,7 @@ // CLASS HEADER #include "watch-application-impl.h" +#include namespace Dali { @@ -41,6 +42,7 @@ WatchApplication::WatchApplication( int* argc, char** argv[], const std::string& : Application(argc, argv, stylesheet, windowMode, PositionSize(), Framework::WATCH), mState( UNINITIALIZED ) { + Dali::StyleMonitor::Get().SetIgnoreGlobalFontSizeChange(1); } WatchApplication::~WatchApplication() -- 2.7.4