From cbdbbb8ea8ab77fb8a5037a30048e102aa437e3e Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Thu, 27 Aug 2020 13:34:57 +0900 Subject: [PATCH] New window is set to the layout direction of tyhe default window. Change-Id: Ic81ecf8134e77b002c7f8ebee1780242e8f8e61c --- dali/internal/adaptor/common/adaptor-impl.cpp | 10 +++++++--- dali/internal/adaptor/common/adaptor-impl.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) mode change 100644 => 100755 dali/internal/adaptor/common/adaptor-impl.cpp mode change 100644 => 100755 dali/internal/adaptor/common/adaptor-impl.h diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp old mode 100644 new mode 100755 index 10a6180..5a65a8e --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -653,6 +653,9 @@ bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow ) Internal::Adaptor::SceneHolder& windowImpl = Dali::GetImplementation( childWindow ); windowImpl.SetAdaptor( Get() ); + // ChildWindow is set to the layout direction of the default window. + windowImpl.GetRootLayer().SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, mRootLayoutDirection ); + // Add the new Window to the container - the order is not important mWindows.push_back( &windowImpl ); @@ -1202,7 +1205,8 @@ Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor, mSocketFactory(), mThreadMode( ThreadMode::NORMAL ), mEnvironmentOptionsOwned( environmentOptions ? false : true /* If not provided then we own the object */ ), - mUseRemoteSurface( false ) + mUseRemoteSurface( false ), + mRootLayoutDirection( Dali::LayoutDirection::LEFT_TO_RIGHT ) { DALI_ASSERT_ALWAYS( !IsAvailable() && "Cannot create more than one Adaptor per thread" ); mWindows.insert( mWindows.begin(), &Dali::GetImplementation( window ) ); @@ -1212,11 +1216,11 @@ Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor, void Adaptor::SetRootLayoutDirection( std::string locale ) { + mRootLayoutDirection = static_cast< LayoutDirection::Type >( Internal::Adaptor::Locale::GetDirection( std::string( locale ) ) ); for ( auto& window : mWindows ) { Dali::Actor root = window->GetRootLayer(); - root.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, - static_cast< LayoutDirection::Type >( Internal::Adaptor::Locale::GetDirection( std::string( locale ) ) ) ); + root.SetProperty( Dali::Actor::Property::LAYOUT_DIRECTION, mRootLayoutDirection ); } } diff --git a/dali/internal/adaptor/common/adaptor-impl.h b/dali/internal/adaptor/common/adaptor-impl.h old mode 100644 new mode 100755 index 2369d51..ec5c645 --- a/dali/internal/adaptor/common/adaptor-impl.h +++ b/dali/internal/adaptor/common/adaptor-impl.h @@ -688,6 +688,7 @@ private: // Data ThreadMode mThreadMode; ///< The thread mode const bool mEnvironmentOptionsOwned:1; ///< Whether we own the EnvironmentOptions (and thus, need to delete it) bool mUseRemoteSurface:1; ///< whether the remoteSurface is used or not + Dali::LayoutDirection::Type mRootLayoutDirection; ///< LayoutDirection of window std::unique_ptr mAddOnManager; ///< Pointer to the addon manager -- 2.7.4