From: ANZ1217 Date: Tue, 9 Jul 2024 08:46:16 +0000 (+0900) Subject: Set default value of removeFrontInset, removeBackInset to false X-Git-Tag: dali_2.3.34~12^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F53%2F314253%2F3;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Set default value of removeFrontInset, removeBackInset to false Change-Id: I8ac716ab2eecc24783091a70bf718aefa063a8cd --- 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 7db4632..93d3fd8 100644 --- 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 @@ -146,6 +146,10 @@ void CreateTextModel(const std::string& text, textModel->mEllipsisPosition = ellipsisPosition; textModel->mVisualModel->SetEllipsisPosition(ellipsisPosition); + //Inset + textModel->mRemoveFrontInset = true; + textModel->mRemoveBackInset = true; + // 1) Convert to utf32 Vector& utf32Characters = logicalModel->mText; utf32Characters.Resize(textSize); diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp index 774cce1..8f8ffe1 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp @@ -725,6 +725,8 @@ int UtcDaliTextControllerSetGetLineSpacingProperty(void) ControllerPtr controller = Controller::New(); ConfigureTextLabel(controller); + controller->SetRemoveFrontInset(true); + controller->SetRemoveBackInset(true); // single line, line spacing = 0px { diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp index ed5ba45..e38e9ec 100755 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp @@ -90,6 +90,8 @@ namespace controller->SetMultiLineEnabled( data.isMultiLines ); controller->SetLineWrapMode( (Text::LineWrap::Mode)(data.lineWrapMode) ); controller->SetEllipsisPosition( data.ellipsisPosition ); + controller->SetRemoveFrontInset(true); + controller->SetRemoveBackInset(true); controller->SetText(data.text); controller->Relayout( data.size ); @@ -259,6 +261,9 @@ namespace controller->SetTextElideEnabled( true ); controller->SetEllipsisPosition( data.ellipsisPosition ); + controller->SetRemoveFrontInset(true); + controller->SetRemoveBackInset(true); + controller->SetText( data.text ); controller->Relayout( data.size ); diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp index dc3f714..0731bb8 100644 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp @@ -250,6 +250,8 @@ int UtcDaliTextViewModelGetLayoutSize(void) // Sets a text and relais-out. controller->SetMarkupProcessorEnabled(true); + controller->SetRemoveFrontInset(true); + controller->SetRemoveBackInset(true); controller->SetText("Lorem ipsum dolor sit amet, aeque definiebas ea mei, posse iracundia ne cum."); controller->Relayout(CONTROL_SIZE); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp index 6a5745c..1adc2fd 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp @@ -1273,13 +1273,13 @@ int UtcDaliTextEditorSetPropertyP(void) DALI_TEST_EQUALS(editor.GetProperty(DevelTextEditor::Property::MIN_LINE_SIZE), 50.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION); // Check Remove Front/Back Inset Property - DALI_TEST_CHECK(editor.GetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET)); - editor.SetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET, false); DALI_TEST_CHECK(!editor.GetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET)); + editor.SetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET, true); + DALI_TEST_CHECK(editor.GetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET)); - DALI_TEST_CHECK(editor.GetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET)); - editor.SetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET, false); DALI_TEST_CHECK(!editor.GetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET)); + editor.SetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET, true); + DALI_TEST_CHECK(editor.GetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET)); application.SendNotification(); application.Render(); @@ -4464,6 +4464,8 @@ int UtcDaliTextEditorHyphenWrapMode(void) TextEditor textEditor = TextEditor::New(); textEditor.SetProperty(Actor::Property::SIZE, Vector2(150.0f, 300.f)); + textEditor.SetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET, true); + textEditor.SetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET, true); application.GetScene().Add(textEditor); application.SendNotification(); @@ -5063,6 +5065,8 @@ int utcDaliTextEditorGeometryEllipsisStart(void) editor.SetProperty(DevelTextEditor::Property::ENABLE_SCROLL_BAR, false); editor.SetProperty(DevelTextEditor::Property::ELLIPSIS, true); editor.SetProperty(DevelTextEditor::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::START); + editor.SetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET, true); + editor.SetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET, true); editor.SetProperty(TextEditor::Property::TEXT, "line1 \nline2\nline 3\nline4"); // Avoid a crash when core load gl resources. @@ -5114,6 +5118,8 @@ int utcDaliTextEditorGeometryEllipsisMiddle(void) editor.SetProperty(DevelTextEditor::Property::ENABLE_SCROLL_BAR, false); editor.SetProperty(DevelTextEditor::Property::ELLIPSIS, true); editor.SetProperty(DevelTextEditor::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::MIDDLE); + editor.SetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET, true); + editor.SetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET, true); editor.SetProperty(TextEditor::Property::TEXT, "line1 \nline2\nline 3\nline4"); // Avoid a crash when core load gl resources. @@ -5165,6 +5171,8 @@ int utcDaliTextEditorGeometryEllipsisEnd(void) editor.SetProperty(DevelTextEditor::Property::ENABLE_SCROLL_BAR, false); editor.SetProperty(DevelTextEditor::Property::ELLIPSIS, true); editor.SetProperty(DevelTextEditor::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::END); + editor.SetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET, true); + editor.SetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET, true); editor.SetProperty(TextEditor::Property::TEXT, "line1 \nline2\nline 3\nline4"); // Avoid a crash when core load gl resources. @@ -5213,6 +5221,8 @@ int utcDaliTextEditorGeometryRTL(void) editor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT); editor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); editor.SetProperty(TextEditor::Property::ENABLE_MARKUP, true); + editor.SetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET, true); + editor.SetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET, true); editor.SetProperty(TextEditor::Property::TEXT, "line1 \nline2\nline 3\nالاخيرالسطر"); // Avoid a crash when core load gl resources. @@ -5312,6 +5322,8 @@ int utcDaliTextEditorGeometryOneGlyph(void) label.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT); label.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); label.SetProperty(TextEditor::Property::ENABLE_MARKUP, true); + label.SetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextEditor::Property::TEXT, "H"); // Avoid a crash when core load gl resources. @@ -6653,11 +6665,15 @@ int utcDaliTextEditorRemoveFrontInset(void) tet_infoline(" utcDaliTextEditorRemoveFrontInset"); TextEditor editor = TextEditor::New(); DALI_TEST_CHECK(editor); + application.GetScene().Add(editor); application.SendNotification(); application.Render(); - DevelTextEditor::SetRemoveFrontInset(editor, false); - DALI_TEST_CHECK(!DevelTextEditor::IsRemoveFrontInset(editor)); + + DALI_TEST_CHECK(!DevelTextEditor::IsRemoveFrontInset(editor)); // default value is false. + DevelTextEditor::SetRemoveFrontInset(editor, true); + DALI_TEST_CHECK(DevelTextEditor::IsRemoveFrontInset(editor)); + END_TEST; } int utcDaliTextEditorRemoveBackInset(void) @@ -6666,10 +6682,14 @@ int utcDaliTextEditorRemoveBackInset(void) tet_infoline(" utcDaliTextEditorRemoveBackInset"); TextEditor editor = TextEditor::New(); DALI_TEST_CHECK(editor); + application.GetScene().Add(editor); application.SendNotification(); application.Render(); - DevelTextEditor::SetRemoveBackInset(editor, false); - DALI_TEST_CHECK(!DevelTextEditor::IsRemoveBackInset(editor)); + + DALI_TEST_CHECK(!DevelTextEditor::IsRemoveBackInset(editor)); // default value is false. + DevelTextEditor::SetRemoveBackInset(editor, true); + DALI_TEST_CHECK(DevelTextEditor::IsRemoveBackInset(editor)); + END_TEST; } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index d098f99..0b0c5d0 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -1275,13 +1275,13 @@ int UtcDaliTextFieldSetPropertyP(void) application.Render(); // Check Remove Front/Back Inset Property - DALI_TEST_CHECK(field.GetProperty(DevelTextField::Property::REMOVE_FRONT_INSET)); - field.SetProperty(DevelTextField::Property::REMOVE_FRONT_INSET, false); DALI_TEST_CHECK(!field.GetProperty(DevelTextField::Property::REMOVE_FRONT_INSET)); + field.SetProperty(DevelTextField::Property::REMOVE_FRONT_INSET, true); + DALI_TEST_CHECK(field.GetProperty(DevelTextField::Property::REMOVE_FRONT_INSET)); - DALI_TEST_CHECK(field.GetProperty(DevelTextField::Property::REMOVE_BACK_INSET)); - field.SetProperty(DevelTextField::Property::REMOVE_BACK_INSET, false); DALI_TEST_CHECK(!field.GetProperty(DevelTextField::Property::REMOVE_BACK_INSET)); + field.SetProperty(DevelTextField::Property::REMOVE_BACK_INSET, true); + DALI_TEST_CHECK(field.GetProperty(DevelTextField::Property::REMOVE_BACK_INSET)); application.SendNotification(); application.Render(); @@ -5035,6 +5035,8 @@ int utcDaliTextFieldGeometryEllipsisStart(void) field.SetProperty(TextField::Property::ENABLE_MARKUP, true); field.SetProperty(DevelTextField::Property::ELLIPSIS, true); field.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::START); + field.SetProperty(DevelTextField::Property::REMOVE_FRONT_INSET, true); + field.SetProperty(DevelTextField::Property::REMOVE_BACK_INSET, true); field.SetProperty(TextField::Property::TEXT, "Hello World"); // Avoid a crash when core load gl resources. @@ -5082,6 +5084,8 @@ int utcDaliTextFieldGeometryEllipsisEnd(void) field.SetProperty(TextField::Property::ENABLE_MARKUP, true); field.SetProperty(DevelTextField::Property::ELLIPSIS, true); field.SetProperty(DevelTextField::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::END); + field.SetProperty(DevelTextField::Property::REMOVE_FRONT_INSET, true); + field.SetProperty(DevelTextField::Property::REMOVE_BACK_INSET, true); field.SetProperty(TextField::Property::TEXT, "Hello World"); // Avoid a crash when core load gl resources. @@ -6166,8 +6170,9 @@ int utcDaliTextFieldRemoveFrontInset(void) application.SendNotification(); application.Render(); - DevelTextField::SetRemoveFrontInset(field, false); - DALI_TEST_CHECK(!DevelTextField::IsRemoveFrontInset(field)); + DALI_TEST_CHECK(!DevelTextField::IsRemoveFrontInset(field)); // default value is false. + DevelTextField::SetRemoveFrontInset(field, true); + DALI_TEST_CHECK(DevelTextField::IsRemoveFrontInset(field)); END_TEST; } @@ -6184,8 +6189,9 @@ int utcDaliTextFieldRemoveBackInset(void) application.SendNotification(); application.Render(); - DevelTextField::SetRemoveBackInset(field, false); - DALI_TEST_CHECK(!DevelTextField::IsRemoveBackInset(field)); + DALI_TEST_CHECK(!DevelTextField::IsRemoveBackInset(field)); // default value is false. + DevelTextField::SetRemoveBackInset(field, true); + DALI_TEST_CHECK(DevelTextField::IsRemoveBackInset(field)); END_TEST; } diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextGeometry.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextGeometry.cpp index 13e8dee..6ce2fb2 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextGeometry.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextGeometry.cpp @@ -63,6 +63,8 @@ int UtcDaliTextGeometryGetLineBoundingRectangleLabel(void) label.SetProperty(TextLabel::Property::POINT_SIZE, 10.f); label.SetProperty(DevelTextLabel::Property::LINE_SPACING, lineSpacing); label.SetProperty(TextLabel::Property::MULTI_LINE, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Lorem ipsum dolor sit amet, \n consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); application.SendNotification(); @@ -89,6 +91,8 @@ int UtcDaliTextGeometryGetLineBoundingRectangleEditor(void) editor.SetProperty(Actor::Property::SIZE, Vector2(160.0f, 250.f)); editor.SetProperty(TextEditor::Property::POINT_SIZE, 10.f); + editor.SetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET, true); + editor.SetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET, true); editor.SetProperty(TextEditor::Property::TEXT, "Lorem ipsum dolor sit amet, \n consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); application.SendNotification(); @@ -116,6 +120,8 @@ int UtcDaliTextGeometryGetLineBoundingRectangleField(void) field.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); field.SetProperty(Actor::Property::SIZE, Vector2(450.0f, 350.f)); field.SetProperty(TextField::Property::POINT_SIZE, 10.f); + field.SetProperty(DevelTextField::Property::REMOVE_FRONT_INSET, true); + field.SetProperty(DevelTextField::Property::REMOVE_BACK_INSET, true); field.SetProperty(TextField::Property::TEXT, "مرحبا بالعالم"); application.SendNotification(); @@ -172,6 +178,8 @@ int UtcDaliTextGeometryLineSpacingPositiveGetLineBoundingRectangleLabel(void) label.SetProperty(TextLabel::Property::POINT_SIZE, 10.f); label.SetProperty(DevelTextLabel::Property::LINE_SPACING, lineSpacing); label.SetProperty(TextLabel::Property::MULTI_LINE, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Lorem ipsum dolor sit amet, \n consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); application.SendNotification(); @@ -200,6 +208,8 @@ int UtcDaliTextGeometryWithVerticalLineAlignmentTopGetLineBoundingRectangleLabel label.SetProperty(TextLabel::Property::POINT_SIZE, 10.f); label.SetProperty(TextLabel::Property::MULTI_LINE, true); label.SetProperty(Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "TOP"); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Lorem ipsum dolor sit amet, \n consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); application.SendNotification(); @@ -228,6 +238,8 @@ int UtcDaliTextGeometryWithVerticalLineAlignmentBottomGetLineBoundingRectangleLa label.SetProperty(TextLabel::Property::POINT_SIZE, 10.f); label.SetProperty(TextLabel::Property::MULTI_LINE, true); label.SetProperty(Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "BOTTOM"); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Lorem ipsum dolor sit amet, \n consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); application.SendNotification(); @@ -256,6 +268,8 @@ int UtcDaliTextGeometryWithEllipsisMiddleGetLineBoundingRectangleLabel(void) label.SetProperty(TextLabel::Property::MULTI_LINE, true); label.SetProperty(TextLabel::Property::ELLIPSIS, true); label.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::MIDDLE); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Lorem ipsum dolor sit amet, \n consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); application.SendNotification(); @@ -285,6 +299,8 @@ int UtcDaliTextGeometryWithEllipsisStartGetLineBoundingRectangleLabel(void) label.SetProperty(TextLabel::Property::MULTI_LINE, true); label.SetProperty(TextLabel::Property::ELLIPSIS, true); label.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::START); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Lorem ipsum dolor sit amet, \n consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); application.SendNotification(); @@ -314,6 +330,8 @@ int UtcDaliTextGeometryWithEllipsisEndGetLineBoundingRectangleLabel(void) label.SetProperty(TextLabel::Property::MULTI_LINE, true); label.SetProperty(TextLabel::Property::ELLIPSIS, true); label.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::END); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Lorem ipsum dolor sit amet, \n consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); application.SendNotification(); @@ -344,6 +362,8 @@ int UtcDaliTextGeometryGetCharacterBoundingRectangleLabel(void) label.SetProperty(TextLabel::Property::POINT_SIZE, 10.f); label.SetProperty(DevelTextLabel::Property::LINE_SPACING, lineSpacing); label.SetProperty(TextLabel::Property::MULTI_LINE, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Lorem ipsum dolor sit amet, \n consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); application.SendNotification(); @@ -374,6 +394,8 @@ int UtcDaliTextGeometryGetCharacterBoundingRectangleEditor(void) editor.SetProperty(Actor::Property::SIZE, Vector2(160.0f, 250.f)); editor.SetProperty(TextEditor::Property::POINT_SIZE, 10.f); + editor.SetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET, true); + editor.SetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET, true); editor.SetProperty(TextEditor::Property::TEXT, "Lorem ipsum dolor sit amet, \n consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); application.SendNotification(); @@ -458,6 +480,8 @@ int UtcDaliTextGeometryLineSpacingPositiveGetCharacterBoundingRectangleLabel(voi label.SetProperty(TextLabel::Property::POINT_SIZE, 10.f); label.SetProperty(DevelTextLabel::Property::LINE_SPACING, lineSpacing); label.SetProperty(TextLabel::Property::MULTI_LINE, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Lorem ipsum dolor sit amet, \n consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); application.SendNotification(); @@ -486,6 +510,8 @@ int UtcDaliTextGeometryWithVerticalLineAlignmentTopGetCharacterBoundingRectangle label.SetProperty(TextLabel::Property::POINT_SIZE, 10.f); label.SetProperty(TextLabel::Property::MULTI_LINE, true); label.SetProperty(Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "TOP"); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Lorem ipsum dolor sit amet, \n consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); application.SendNotification(); @@ -514,6 +540,8 @@ int UtcDaliTextGeometryWithVerticalLineAlignmentBottomGetCharacterBoundingRectan label.SetProperty(TextLabel::Property::POINT_SIZE, 10.f); label.SetProperty(TextLabel::Property::MULTI_LINE, true); label.SetProperty(Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "BOTTOM"); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Lorem ipsum dolor sit amet, \n consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."); application.SendNotification(); @@ -566,6 +594,8 @@ int UtcDaliTextGeometryGetCharacterIndexAtPositionTextEditor(void) editor.SetProperty(Actor::Property::SIZE, Vector2(160.0f, 250.f)); editor.SetProperty(TextEditor::Property::POINT_SIZE, 10.f); + editor.SetProperty(DevelTextEditor::Property::REMOVE_FRONT_INSET, true); + editor.SetProperty(DevelTextEditor::Property::REMOVE_BACK_INSET, true); editor.SetProperty(TextEditor::Property::TEXT, "Hello everyone."); application.SendNotification(); @@ -645,6 +675,8 @@ int UtcDaliTextGeometryGetCharacterIndexAtPositionLastCharacter(void) label.SetProperty(Actor::Property::SIZE, Vector2(450.0f, 300.f)); label.SetProperty(TextLabel::Property::POINT_SIZE, 10.f); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Hello"); application.SendNotification(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp index aed1457..392900b 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -1032,13 +1032,13 @@ int UtcDaliToolkitTextLabelSetPropertyP(void) application.Render(); // Check Remove Front/Back Inset Property - DALI_TEST_CHECK(label.GetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET)); - label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, false); DALI_TEST_CHECK(!label.GetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET)); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + DALI_TEST_CHECK(label.GetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET)); - DALI_TEST_CHECK(label.GetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET)); - label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, false); DALI_TEST_CHECK(!label.GetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET)); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); + DALI_TEST_CHECK(label.GetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET)); application.SendNotification(); application.Render(); @@ -1708,6 +1708,8 @@ int UtcDaliToolkitTextlabelTextWrapMode(void) TextLabel label = TextLabel::New(); label.SetProperty(Actor::Property::SIZE, Vector2(300.0f, 300.f)); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Hello world Hello world"); label.SetProperty(TextLabel::Property::MULTI_LINE, true); @@ -2043,6 +2045,8 @@ int UtcDaliToolkitTextlabelTextFit(void) TextLabel label = TextLabel::New(); Vector2 size(460.0f, 100.0f); label.SetProperty(Actor::Property::SIZE, size); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Hello world"); // connect to the text git changed signal. @@ -2099,6 +2103,8 @@ int UtcDaliToolkitTextlabelTextFitStressTest(void) TextLabel label = TextLabel::New(); Vector2 size(460.0f, 100.0f); label.SetProperty(Actor::Property::SIZE, size); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "Hello world"); // connect to the text git changed signal. @@ -2224,6 +2230,8 @@ int UtcDaliToolkitTextlabelTextFitArray(void) TextLabel label = TextLabel::New(); Vector2 size(300.0f, 80.0f); label.SetProperty(Actor::Property::SIZE, size); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog"); label.SetProperty(DevelTextLabel::Property::MIN_LINE_SIZE, 80.f); label.SetProperty(TextLabel::Property::POINT_SIZE, 10.f); @@ -2746,6 +2754,8 @@ int UtcDaliTextLabelHyphenWrapMode(void) label.SetProperty(Actor::Property::SIZE, Vector2(150.0f, 300.f)); label.SetProperty(TextLabel::Property::POINT_SIZE, 12.f); label.SetProperty(TextLabel::Property::MULTI_LINE, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); application.GetScene().Add(label); application.SendNotification(); application.Render(); @@ -2841,6 +2851,8 @@ int utcDaliTextLabelGeometryRTL(void) label.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); label.SetProperty(TextLabel::Property::ENABLE_MARKUP, true); label.SetProperty(TextLabel::Property::MULTI_LINE, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "line1 \nline2\nline 3\nالاخيرالسطر"); // Avoid a crash when core load gl resources. application.GetGlAbstraction().SetCheckFramebufferStatusResult(GL_FRAMEBUFFER_COMPLETE); @@ -2939,6 +2951,8 @@ int utcDaliTextLabelGeometryOneGlyph(void) label.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT); label.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); label.SetProperty(TextLabel::Property::ENABLE_MARKUP, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_FRONT_INSET, true); + label.SetProperty(DevelTextLabel::Property::REMOVE_BACK_INSET, true); label.SetProperty(TextLabel::Property::TEXT, "H"); // Avoid a crash when core load gl resources. @@ -3381,8 +3395,9 @@ int utcDaliTextLabelRemoveFrontInset(void) application.SendNotification(); application.Render(); - DevelTextLabel::SetRemoveFrontInset(label, false); - DALI_TEST_CHECK(!DevelTextLabel::IsRemoveFrontInset(label)); + DALI_TEST_CHECK(!DevelTextLabel::IsRemoveFrontInset(label)); // default value is false. + DevelTextLabel::SetRemoveFrontInset(label, true); + DALI_TEST_CHECK(DevelTextLabel::IsRemoveFrontInset(label)); END_TEST; } @@ -3399,8 +3414,9 @@ int utcDaliTextLabelRemoveBackInset(void) application.SendNotification(); application.Render(); - DevelTextLabel::SetRemoveBackInset(label, false); - DALI_TEST_CHECK(!DevelTextLabel::IsRemoveBackInset(label)); + DALI_TEST_CHECK(!DevelTextLabel::IsRemoveBackInset(label)); // default value is false. + DevelTextLabel::SetRemoveBackInset(label, true); + DALI_TEST_CHECK(DevelTextLabel::IsRemoveBackInset(label)); END_TEST; } \ No newline at end of file diff --git a/dali-toolkit/internal/text/text-model.cpp b/dali-toolkit/internal/text/text-model.cpp index 9a4e761..ecb0b35 100644 --- a/dali-toolkit/internal/text/text-model.cpp +++ b/dali-toolkit/internal/text/text-model.cpp @@ -398,8 +398,8 @@ Model::Model() mAlignmentOffset(0.0f), mElideEnabled(false), mIgnoreSpacesAfterText(true), - mRemoveFrontInset(true), - mRemoveBackInset(true), + mRemoveFrontInset(false), + mRemoveBackInset(false), mMatchLayoutDirection(DevelText::MatchLayoutDirection::INHERIT), mEllipsisPosition(DevelText::EllipsisPosition::END) {