From: joogab yun Date: Thu, 24 Jun 2021 09:34:15 +0000 (+0000) Subject: Merge "Change MatchSystemLanguageDirection is true." into devel/master X-Git-Tag: dali_2.0.32~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=93ad73e0e2c46aca4c191a1e2f075061e167e8b5;hp=803fc4e52d3fc95261c5af0b05c25d6bf243bc00 Merge "Change MatchSystemLanguageDirection is true." into devel/master --- diff --git a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp index 9f77f91..6028e02 100755 --- a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp +++ b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp @@ -383,6 +383,9 @@ void ConfigureTextLabel( ControllerPtr controller ) // Enable the text elide. controller->SetTextElideEnabled( true ); + + // Disable match system language direction + controller->SetMatchSystemLanguageDirection(false); } void ConfigureTextField( ControllerPtr controller ) @@ -412,6 +415,9 @@ void ConfigureTextField( ControllerPtr controller ) // Disable the text elide. controller->SetTextElideEnabled( false ); + + // Disable match system language direction + controller->SetMatchSystemLanguageDirection(false); } void ConfigureTextEditor( ControllerPtr controller ) @@ -441,6 +447,9 @@ void ConfigureTextEditor( ControllerPtr controller ) // Disable the text elide. controller->SetTextElideEnabled( false ); + + // Disable match system language direction + controller->SetMatchSystemLanguageDirection(false); } } // namespace Text diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp index 675e2c7..31d1762 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp @@ -3048,13 +3048,13 @@ int UtcDaliTextEditorMatchSystemLanguageDirectionProperty(void) application.SendNotification(); application.Render(); - // The default value of MATCH_SYSTEM_LANGUAGE_DIRECTION is 'false'. - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), false, TEST_LOCATION ); - - // Check the enable match system language direction property - editor.SetProperty( DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, true ); + // The default value of MATCH_SYSTEM_LANGUAGE_DIRECTION is 'true'. DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), true, TEST_LOCATION ); + // Check the disable match system language direction property + editor.SetProperty( DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, false ); + DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), false, TEST_LOCATION ); + application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index 51d27c8..2044ea3 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -3162,12 +3162,12 @@ int UtcDaliTextFieldMatchSystemLanguageDirectionProperty(void) application.SendNotification(); application.Render(); - // The default value of MATCH_SYSTEM_LANGUAGE_DIRECTION is 'false'. - DALI_TEST_EQUALS( field.GetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), false, TEST_LOCATION ); + // The default value of MATCH_SYSTEM_LANGUAGE_DIRECTION is 'true'. + DALI_TEST_EQUALS( field.GetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), true, TEST_LOCATION ); // Check the match system language direction property - field.SetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, true ); - DALI_TEST_EQUALS( field.GetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), true, TEST_LOCATION ); + field.SetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, false ); + DALI_TEST_EQUALS( field.GetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), false, TEST_LOCATION ); application.SendNotification(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp index 9a187d6..f505faf 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -1512,6 +1512,7 @@ int UtcDaliToolkitTextlabelTextDirection(void) label.SetProperty( TextLabel::Property::TEXT, "Hello world" ); label.SetProperty( TextLabel::Property::POINT_SIZE, 20 ); + label.SetProperty( DevelTextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, false ); application.GetScene().Add( label ); // Test LTR text diff --git a/dali-toolkit/internal/text/text-model.cpp b/dali-toolkit/internal/text/text-model.cpp index 26a9be8..3868979 100644 --- a/dali-toolkit/internal/text/text-model.cpp +++ b/dali-toolkit/internal/text/text-model.cpp @@ -18,12 +18,20 @@ // CLASS HEADER #include +// EXTERNAL INCLUDES +#include + namespace Dali { namespace Toolkit { namespace Text { +namespace +{ +const char* DALI_ENV_MATCH_SYSTEM_LANGUAGE_DIRECTION("DALI_MATCH_SYSTEM_LANGUAGE_DIRECTION"); +} + ModelPtr Model::New() { return ModelPtr(new Model()); @@ -221,10 +229,14 @@ Model::Model() mAlignmentOffset(0.0f), mElideEnabled(false), mIgnoreSpacesAfterText(true), - mMatchSystemLanguageDirection(false) + mMatchSystemLanguageDirection(true) { mLogicalModel = LogicalModel::New(); mVisualModel = VisualModel::New(); + + // Check environment variable for DALI_MATCH_SYSTEM_LANGUAGE_DIRECTION + auto match = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_MATCH_SYSTEM_LANGUAGE_DIRECTION); + mMatchSystemLanguageDirection = match ? (std::atoi(match) == 0 ? false : true) : mMatchSystemLanguageDirection; } Model::~Model()