From 9af50c418a59d3ab207f41c0eb41c510e9ee45f9 Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Mon, 5 Nov 2018 17:19:14 +0900 Subject: [PATCH] Revert "[Tizen] support match align for system language direciton on text Field and" This reverts commit 08279d3c6b3090539143b065eb1c1fee04e2e16c. --- .../src/dali-toolkit/utc-Dali-TextEditor.cpp | 31 ------ .../src/dali-toolkit/utc-Dali-TextField.cpp | 105 --------------------- .../controls/text-controls/text-editor-devel.h | 9 +- .../controls/text-controls/text-field-devel.h | 10 +- .../controls/text-controls/text-editor-impl.cpp | 17 ---- .../controls/text-controls/text-field-impl.cpp | 17 ---- .../internal/text/text-controller-impl.cpp | 32 +------ .../1920x1080/dali-toolkit-default-theme.json | 6 +- 8 files changed, 5 insertions(+), 222 deletions(-) mode change 100755 => 100644 dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp index 49889ff..dd538d4 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp @@ -101,8 +101,6 @@ const char* const PROPERTY_NAME_ENABLE_SELECTION = "enableSe const char* const PROPERTY_NAME_PLACEHOLDER = "placeholder"; const char* const PROPERTY_NAME_ENABLE_SHIFT_SELECTION = "enableShiftSelection"; const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE = "enableGrabHandle"; -const char* const PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION = "matchSystemLanguageDirection"; - const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND; @@ -544,7 +542,6 @@ int UtcDaliTextEditorGetPropertyP(void) DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR ) == DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR ); DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SHIFT_SELECTION ) == DevelTextEditor::Property::ENABLE_SHIFT_SELECTION ); DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE ) == DevelTextEditor::Property::ENABLE_GRAB_HANDLE ); - DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION ) == DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ); END_TEST; } @@ -2880,34 +2877,6 @@ int UtcDaliTextEditorEnableGrabHandleProperty(void) END_TEST; } -int UtcDaliTextEditorMatchSystemLanguageDirectionProperty(void) -{ - ToolkitTestApplication application; - tet_infoline("UtcDaliTextEditorMatchSystemLanguageDirectionProperty"); - - TextEditor editor = TextEditor::New(); - DALI_TEST_CHECK( editor ); - editor.SetSize( 300.f, 50.f ); - editor.SetParentOrigin( ParentOrigin::TOP_LEFT ); - editor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - Stage::GetCurrent().Add( editor ); - - 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 ); - DALI_TEST_EQUALS( editor.GetProperty( DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), true, TEST_LOCATION ); - - application.SendNotification(); - application.Render(); - - END_TEST; -} - int UtcDaliTextEditorGetInputMethodContext(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index 1926b5a..64a5d55 100755 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -103,7 +103,6 @@ const char* const PROPERTY_NAME_PLACEHOLDER = "placehol const char* const PROPERTY_NAME_ELLIPSIS = "ellipsis"; const char* const PROPERTY_NAME_ENABLE_SHIFT_SELECTION = "enableShiftSelection"; const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE = "enableGrabHandle"; -const char* const PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION = "matchSystemLanguageDirection"; const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND; @@ -549,7 +548,6 @@ int UtcDaliTextFieldGetPropertyP(void) DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS ) == TextField::Property::ELLIPSIS ); DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_SHIFT_SELECTION ) == DevelTextField::Property::ENABLE_SHIFT_SELECTION ); DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE ) == DevelTextField::Property::ENABLE_GRAB_HANDLE ); - DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION ) == DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ); END_TEST; } @@ -2825,108 +2823,6 @@ int UtcDaliTextFieldEnableGrabHandleProperty(void) END_TEST; } -int UtcDaliTextFieldMatchSystemLanguageDirectionProperty(void) -{ - ToolkitTestApplication application; - tet_infoline("UtcDaliTextFieldMatchSystemLanguageDirectionProperty"); - - TextField field = TextField::New(); - DALI_TEST_CHECK( field ); - field.SetSize( 300.f, 50.f ); - field.SetParentOrigin( ParentOrigin::TOP_LEFT ); - field.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - Stage::GetCurrent().Add( field ); - - 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 ); - - // 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 ); - - application.SendNotification(); - application.Render(); - - END_TEST; -} - -int utcDaliTextFieldLayoutDirectionCoverage(void) -{ - ToolkitTestApplication application; - tet_infoline(" utcDaliTextFieldLayoutDirectionCoverage"); - - // Creates a tap event. After creating a tap event the text field should - // have the focus and add text with key events should be possible. - TextField field = TextField::New(); - DALI_TEST_CHECK( field ); - - Stage::GetCurrent().Add( field ); - - field.SetSize( 300.f, 50.f ); - field.SetParentOrigin( ParentOrigin::TOP_LEFT ); - field.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - - // Avoid a crash when core load gl resources. - application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); - - // Render and notify - application.SendNotification(); - application.Render(); - - // Set MATCH_SYSTEM_LANGUAGE_DIRECTION to true to use the layout direction. - field.SetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, true ); - field.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT ); - - // Set horizontal alignment BEGIN - field.SetProperty( TextField::Property::HORIZONTAL_ALIGNMENT, "BEGIN"); - - // Create a tap event to touch the text field. - application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) ); - application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) ); - - // Render and notify - application.SendNotification(); - application.Render(); - - // Set horizontal alignment CENTER - field.SetProperty( TextField::Property::HORIZONTAL_ALIGNMENT, "CENTER"); - - // Create a tap event to touch the text field. - application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) ); - application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) ); - - // Render and notify - application.SendNotification(); - application.Render(); - - // Set horizontal alignment END - field.SetProperty( TextField::Property::HORIZONTAL_ALIGNMENT, "END"); - - // Create a tap event to touch the text field. - application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) ); - application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 150.0f, 25.0f ) ) ); - - // Render and notify - application.SendNotification(); - application.Render(); - - // Generate a Esc key event. The text field should lose the focus. - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Down, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - application.ProcessEvent( GenerateKey( "", "", DALI_KEY_ESCAPE, 0, 0, Integration::KeyEvent::Up, "", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) ); - - // Render and notify - application.SendNotification(); - application.Render(); - - DALI_TEST_EQUALS( false, field.HasKeyInputFocus(), TEST_LOCATION ); - - END_TEST; -} - - int UtcDaliTextFieldGetInputMethodContext(void) { ToolkitTestApplication application; @@ -2937,4 +2833,3 @@ int UtcDaliTextFieldGetInputMethodContext(void) END_TEST; } - diff --git a/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h b/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h index 4d600b5..7bed333 100755 --- a/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h +++ b/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h @@ -110,14 +110,7 @@ namespace Property * @details Name "enableGrabHandle", type Property::BOOLEAN. * @note The default value is true, which means the grab handles are enabled by default. */ - ENABLE_GRAB_HANDLE, - - /** - * @brief Modifies the default text alignment to match the direction of the system language. - * @details Name "matchSystemLanguageDirection", type (Property::BOOLEAN), Read/Write - * @note The default value is false - */ - MATCH_SYSTEM_LANGUAGE_DIRECTION + ENABLE_GRAB_HANDLE }; } // namespace Property diff --git a/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h index 7608577..dea5ded 100755 --- a/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h +++ b/dali-toolkit/devel-api/controls/text-controls/text-field-devel.h @@ -100,15 +100,7 @@ namespace Property * @details Name "enableGrabHandle", type Property::BOOLEAN. * @note The default value is true, which means the grab handles are enabled by default. */ - ENABLE_GRAB_HANDLE = ELLIPSIS + 2, - - /** - * @brief Modifies the default text alignment to match the direction of the system language. - * @details Name "matchSystemLanguageDirection", type (Property::BOOLEAN), Read/Write - * @note The default value is false - */ - MATCH_SYSTEM_LANGUAGE_DIRECTION = ELLIPSIS + 3 - + ENABLE_GRAB_HANDLE = ELLIPSIS + 2 }; } // namespace Property diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp index b065e99..5196d17 100755 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -138,7 +138,6 @@ DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderText", DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderTextColor", VECTOR4, PLACEHOLDER_TEXT_COLOR ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableShiftSelection", BOOLEAN, ENABLE_SHIFT_SELECTION ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableGrabHandle", BOOLEAN, ENABLE_GRAB_HANDLE ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "matchSystemLanguageDirection", BOOLEAN, MATCH_SYSTEM_LANGUAGE_DIRECTION ) DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "textChanged", SIGNAL_TEXT_CHANGED ) DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED ) @@ -746,14 +745,6 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P } break; } - case Toolkit::DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION: - { - if( impl.mController ) - { - impl.mController->SetMatchSystemLanguageDirection(value.Get< bool >()); - } - break; - } } // switch } // texteditor } @@ -1154,14 +1145,6 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind } break; } - case Toolkit::DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION: - { - if( impl.mController ) - { - value = impl.mController->IsMatchSystemLanguageDirection(); - } - break; - } } //switch } diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp index 655c335..5077ced 100755 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -132,7 +132,6 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder", DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "ellipsis", BOOLEAN, ELLIPSIS ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableShiftSelection", BOOLEAN, ENABLE_SHIFT_SELECTION ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "enableGrabHandle", BOOLEAN, ENABLE_GRAB_HANDLE ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextField, "matchSystemLanguageDirection", BOOLEAN, MATCH_SYSTEM_LANGUAGE_DIRECTION ) DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "textChanged", SIGNAL_TEXT_CHANGED ) DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "maxLengthReached", SIGNAL_MAX_LENGTH_REACHED ) @@ -786,14 +785,6 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr } break; } - case Toolkit::DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION: - { - if( impl.mController ) - { - impl.mController->SetMatchSystemLanguageDirection(value.Get< bool >()); - } - break; - } } // switch } // textfield } @@ -1209,14 +1200,6 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde } break; } - case Toolkit::DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION: - { - if( impl.mController ) - { - value = impl.mController->IsMatchSystemLanguageDirection(); - } - break; - } } //switch } diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 79d8a41..97a3da9 100755 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -2741,37 +2741,7 @@ void Controller::Impl::GetCursorPosition( CharacterIndex logical, cursorInfo.lineHeight = GetDefaultFontLineHeight(); cursorInfo.primaryCursorHeight = cursorInfo.lineHeight; - bool isRTL = false; - HorizontalAlignment::Type alignment = mModel->mHorizontalAlignment; - if( mModel->mMatchSystemLanguageDirection ) - { - isRTL = mLayoutDirection == LayoutDirection::RIGHT_TO_LEFT; - } - // Swap the alignment type if the line is right to left. - if( isRTL ) - { - switch( alignment ) - { - case HorizontalAlignment::BEGIN: - { - alignment = HorizontalAlignment::END; - break; - } - case HorizontalAlignment::CENTER: - { - // Nothing to do. - break; - } - case HorizontalAlignment::END: - { - alignment = HorizontalAlignment::BEGIN; - break; - } - } - } - - - switch( alignment ) + switch( mModel->mHorizontalAlignment ) { case Text::HorizontalAlignment::BEGIN : { diff --git a/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json b/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json old mode 100755 new mode 100644 index 4322001..842a568 --- a/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json +++ b/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json @@ -102,8 +102,7 @@ "grabHandleImage" : "{DALI_STYLE_IMAGE_DIR}cursor_handler_drop_center.png", "selectionHandleImageLeft" : {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_left.png" }, "selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" }, - "enableSelection":false, - "matchSystemLanguageDirection":true + "enableSelection":false }, "TextFieldFontSize0": @@ -219,8 +218,7 @@ "enableScrollBar":true, "scrollBarShowDuration":0.8, "scrollBarFadeDuration":0.5, - "enableSelection":false, - "matchSystemLanguageDirection":true + "enableSelection":false }, "ProgressBar": { -- 2.7.4