Moved Text Controller & Markup Processor to sub-folders Change-Id: If5a17c1c568584840ec7f07ebe24cd72bc6a0356
fix incorrect calculaion of natural size in text In DoRelayout of GetNaturalSize/GetHeightForWidth, operationsPending should inlcude LAYOUT. Without this, incorrect size calculations will occur. Change-Id: I4cfcf392d07eac2b5929b7b2cc36d08c8fc519a8 Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
Fix text AutoScroll ellipsis issue Text should ellipsis while AutoScroll is running when text length is bigger than MaxTextureSize. this issue occurs as a side effect of another patch. 74f7af1b08ce65dde5959d22b2d533cbc64b9d2e the height comparison condition is for another AutoScroll ellipsis issue and this should not be removed. Change-Id: I18a4011bec882e483bc0c184417403661a9fa635 Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
Fix incorrect calc of GetHeightForWidth in TextLabel the recent change of CalculateLayoutSizeOnRequiredControllerSize() causes compatibility issues in TextLabel. avoiding backup/restore of visual-model fields after GetNaturalSize/GetHeightForWidth is usually to resolve broken index of editable controls. this patch DoRelayout() with minimal operation when non-editable case. it's almost like legacy code. Change-Id: Ib918c96ad45fc3567941bec17dffe910b8b45134 Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
Add vertical alignment for text editor - Support VerticalAlignment for TextEditor - If the layout size is bigger than control size, there is no meaning in calculating the vertical offset. - But when the text is empty, the cursor position should be updated according to the vertical alignment. Change-Id: I219abf970ff4cb3ce0540244a3f6fd4ed41d24e8 Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
Support align attribute for paragraph tag in markup <p align='center'> text </p> Values: begin | center | end //How to apply it: textEditorMultiAlign.SetProperty(TextEditor::Property::TEXT, "text outside<p align='end'>Paragraph end</p><p align='center'>Paragraph center</p><p align='begin' >Paragraph begin</p><p>Paragraph property alignment</p>"); textEditorMultiAlign.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true); //The alignment on property level works on outside text or on a paragraph without the align attribute textEditorMultiAlign.SetProperty(TextEditor::Property::HORIZONTAL_ALIGNMENT, Dali::Toolkit::Text::HorizontalAlignment::CENTER); Change-Id: I3ccd6e6669a5887cdcbfa80be44998fd487e580c
Fix text cursor position issue When the size or direction of text is changed, all decorator elements should be updated. Change-Id: Ib2fb61f684801c5743762df67e8e6d53399c8098 Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
Set FullRelayoutNeeded after GetNaturalSize/GetHeightForWidth to avoid the backup/restore of fields in visual-model. This solved some issues happen after calling GetNaturalSize/GetHeightForWidth or after initialization when set WIDTH_RESIZE_POLICY to ResizePolicy::USE_NATURAL_SIZE 1) Fixing the issue where characters were being drawn at the same location whenever GetNaturalSize was called. https://review.tizen.org/gerrit/c/platform/core/uifw/dali-toolkit/+/253286 2) Side effect on Scrolling, LineWrap and Invalid position of cursor in TextEditor after calling GetNaturalSize or GetHeightForWidth. https://review.tizen.org/gerrit/c/platform/core/uifw/dali-toolkit/+/255379 3) Crash issue when set WIDTH_RESIZE_POLICY to ResizePolicy::USE_NATURAL_SIZE in TextEditor then insert/remove characters from 2nd line in it after initialization 4) Crash issue when set WIDTH_RESIZE_POLICY to ResizePolicy::USE_NATURAL_SIZE in TextEditor and select_text at initialization then cut it after initialization 5) Crash issue when set WIDTH_RESIZE_POLICY to ResizePolicy::USE_NATURAL_SIZE in TextEditor then double enter in it after initialization 6) Incorrect NaturalSize after the second call for GetNaturalSize. This issue in TextLabel when call GetNaturalSize, then set MULTI_LINE, then re-call GetNaturalSize with Text has break-line Change-Id: Ieea984f41a218c62e016baa60156b51e985f2fc0
Fix text relayouter update issue When the size of the text control is 0, there is a issue that the mRequestedNumberOfCharacters becomes 0 even if the actural text exists. This patch avoids this issue by updating mNumberOfCharactersToAdd in textUpdateInfo in that situation. Change-Id: I440b39f846aa7c9c410a1d121dae7b8a63b811ae Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
Removed some redundant methods from TextController & Moved some code to other files Change-Id: Ib57da54aa520a15f346e24be93e35a18caa0315b
Merge "Add a callback to get textfitted font size." into devel/master
(TextController/ScrollView) Reduced LOC - TextController - Moved some methods to the Impl class - TextControllerImpl - Moved a lot of functionality outside of the class - ScrollView - Added a class which handles the properties Change-Id: I69127a9bc3dbd3e892f1fe0019cac9ad41fc2f3e
Add a callback to get textfitted font size. Change-Id: I1aea1a5d5b03a27c89feb709d4877369c29290bb
Support Ellipsis Position Property Added new property Ellipsis to TextEditor Added new property Ellipsis_Position to TextLabel, TextField and TextEditor Example: textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::START); Handled Ellipsis location for below cases: Positions: END, START and MIDDLE TextController: TextLabel, TextField and TextEditor SingleLine and Muilt-lines with differnat LineWrap modes Text direction LTR and RTL END algorithm already exits START and MIDDLE algorithms added according to END one Change-Id: If059878f7128141169e95cf237b690ce900c70b3
Makes the LTR/RTL alignment of text follow the system language by default. The MATCH_SYSTEM_LANGUAGE_DIRECTION property defaults to true. When the layout direction of TextLabel, TextField, or TextEditor is changed, LTR/RTL alignment of text follows the layout direction of each control. If you set MATCH_SYSTEM_LANGUAGE_DIRECTION to false As before, LTR/RTL is determined according to the language of the text. Change-Id: Ie97654a2309ffd4c30bec2c1b95d6337d8f4c674
Reduce unnecessary calc in CalculateVerticalOffset() The calculation for offsetY is only needed when the placeholder is show. This patch adds that condition, reducing unnecessary calculations. Change-Id: I264671de296236f069971081999063524105897b Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
Fix the LineCount issue when text is changed. There is an issue with LineCount of TextLabel and TextEditor. The issue is that if you set Text in TextLabel and do GetLineCount, an incorrect LineCount is returned. This issue related to GetHeightForWidth which called in Controller::GetLineCount(float width). Change-Id: Ia0cc5737432080fbd925bc6e655062f023a1c133
This is a hotfix for side effect on Scrolling, LineWrap and Invalid position of cursor in TextEditor after calling GetNaturalSize or GetHeightForWidth. The number of lines and glyph-positions in visualModel have been changed by calling DoRelayout with size does not equal actualControlSize. Solution: Store the mLines and mGlyphPositions from visualModel so that they can be restored later on with no modifications made on them. Change-Id: Ic14995e1c178b094107f4317e9d3835d6bec7470
Fixing the issue where characters were being drawn at the same location whenever GetNaturalSize was called. ********************************************************************************* Description: GetNaturalSize method was updating a copy by reference of the pending operations mask. The value of the mask was being updated to Layout and Render. After calling GetNaturalSize and giving focus to the editor by tapping it, the UpdateModel was attempting to perform an update based on the mask but had no update details stored in the the object and this caused all the characters to be pushed to the same paragraph. The change stored a back-up of the mask as soon as it entered the GetNaturalSize so that its value can be restored before exiting GetNaturalSize. This ensured that no modifications made on the mask copy while getting the natural size were reflected on the original mask. The utc checks on the line count before calling GetNaturalSize and tapping the text-editor and after doing so. The line count is expected to not change. ********************************************************************************* using namespace Dali; using namespace Dali::Toolkit; class SimpleApp : public ConnectionTracker { public: SimpleApp(Application& application) : mApplication(application) { mApplication.InitSignal().Connect(this, &SimpleApp::Create); } void Create(Application& application) { Window window = application.GetWindow(); mEditor = TextEditor::New(); mEditor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER); mEditor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER); mEditor.SetProperty(Actor::Property::POSITION, Vector3(0.f, 0.0f, 0.f)); mEditor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 100.0f)); mEditor.SetBackgroundColor(Vector4(0.04f, 0.345f, 0.392f, 1.0f)); mEditor.SetProperty(TextEditor::Property::TEXT, "A\na\n"); mButton = PushButton::New(); mButton.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER); mButton.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER); mButton.SetProperty(Actor::Property::SIZE, Vector2(100.f, 50.0f)); mButton.SetProperty(Actor::Property::POSITION, Vector3(0.f, 0.0f, 0.f)); mButton.SetProperty(Button::Property::LABEL, "click"); mButton.SetBackgroundColor(Vector4(0.5f, 0.5f, 0.5f, 1.0f)); mButton.ClickedSignal().Connect(this, &SimpleApp::OnButtonClicked); window.Add(mButton); window.Add(mEditor); } std::string str1,str2; bool OnButtonClicked(Button button) { if(button == mButton) { Vector3 originalSize = mEditor.GetNaturalSize(); } return true; } private: Application& mApplication; TextEditor mEditor; PushButton mButton; }; int DALI_EXPORT_API main(int argc, char** argv) { Application application = Application::New(&argc, &argv); SimpleApp test(application); application.MainLoop(); return 0; } Change-Id: I287f2f195d861a2cebbb256195d25cb653702dc7
Prevent height adjustment of TextLabel Cursor position issue occurs when the text control is editable. isEditable flag prevents wrong resizing in TextLabel. Change-Id: I15eb8ec37bead595caaf600f9a1f7163c3c98bcd Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>