Merge "When matchSystemLanguageDirection is set, it should follow the direction setti...
authorjoogab yun <joogab.yun@samsung.com>
Fri, 28 Aug 2020 00:49:42 +0000 (00:49 +0000)
committerGerrit Code Review <gerrit@review>
Fri, 28 Aug 2020 00:49:42 +0000 (00:49 +0000)
1  2 
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp

index adfd0ae,b297a90..14bac16
mode 100644,100755..100755
@@@ -22,6 -22,7 +22,7 @@@
  #include <cstring>
  #include <limits>
  #include <dali/public-api/adaptor-framework/key.h>
+ #include <dali/devel-api/adaptor-framework/window-devel.h>
  #include <dali/devel-api/common/stage.h>
  #include <dali/devel-api/actors/actor-devel.h>
  #include <dali/devel-api/object/property-helper-devel.h>
@@@ -1400,7 -1401,15 +1401,15 @@@ void TextEditor::OnRelayout( const Vect
    Vector2 contentSize( size.x - ( padding.start + padding.end ), size.y - ( padding.top + padding.bottom ) );
  
    // Support Right-To-Left of padding
-   Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+   Dali::LayoutDirection::Type layoutDirection;
+   if( mController->IsMatchSystemLanguageDirection() )
+   {
+     layoutDirection = static_cast<Dali::LayoutDirection::Type>( DevelWindow::Get( self ).GetRootLayer().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+   }
+   else
+   {
+     layoutDirection = static_cast<Dali::LayoutDirection::Type>( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+   }
    if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection )
    {
      std::swap( padding.start, padding.end );
@@@ -1597,7 -1606,7 +1606,7 @@@ bool TextEditor::OnKeyEvent( const KeyE
    if( Dali::DALI_KEY_ESCAPE == event.GetKeyCode() && mController->ShouldClearFocusOnEscape() )
    {
      // Make sure ClearKeyInputFocus when only key is up
 -    if( event.GetState() == KeyEvent::Up )
 +    if( event.GetState() == KeyEvent::UP )
      {
        ClearKeyInputFocus();
      }
index e3110ad,467748d..8f0381e
mode 100644,100755..100755
@@@ -22,6 -22,7 +22,7 @@@
  #include <cstring>
  #include <dali/public-api/adaptor-framework/key.h>
  #include <dali/devel-api/adaptor-framework/key-devel.h>
+ #include <dali/devel-api/adaptor-framework/window-devel.h>
  #include <dali/devel-api/common/stage.h>
  #include <dali/devel-api/object/property-helper-devel.h>
  #include <dali/devel-api/actors/actor-devel.h>
@@@ -1433,7 -1434,15 +1434,15 @@@ void TextField::OnRelayout( const Vecto
    Vector2 contentSize( size.x - ( padding.start + padding.end ), size.y - ( padding.top + padding.bottom ) );
  
    // Support Right-To-Left of padding
-   Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+   Dali::LayoutDirection::Type layoutDirection;
+   if( mController->IsMatchSystemLanguageDirection() )
+   {
+     layoutDirection = static_cast<Dali::LayoutDirection::Type>( DevelWindow::Get( self ).GetRootLayer().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+   }
+   else
+   {
+     layoutDirection = static_cast<Dali::LayoutDirection::Type>( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+   }
    if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection )
    {
      std::swap( padding.start, padding.end );
@@@ -1684,7 -1693,7 +1693,7 @@@ bool TextField::OnKeyEvent( const KeyEv
    if( Dali::DALI_KEY_ESCAPE == event.GetKeyCode() && mController->ShouldClearFocusOnEscape() )
    {
      // Make sure ClearKeyInputFocus when only key is up
 -    if( event.GetState() == KeyEvent::Up )
 +    if( event.GetState() == KeyEvent::UP )
      {
        ClearKeyInputFocus();
      }