X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-editor-impl.cpp;h=eb05cf185bbf7fd9159c9808b55f4a379161b02a;hp=72503a522ee402324be6956caf1b8a77c7358823;hb=646440beeb663fc5efcccadeba73dd46016ed1b3;hpb=589e75120f8d7f883509a56d7aeb459644e83ed9 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 72503a5..eb05cf1 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -20,7 +20,6 @@ // EXTERNAL INCLUDES #include -#include #include #include #include @@ -698,7 +697,7 @@ void TextEditor::SetProperty(BaseObject* object, Property::Index index, const Pr } case Toolkit::DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION: { - impl.mController->SetMatchSystemLanguageDirection(value.Get()); + impl.mController->SetMatchLayoutDirection(value.Get() ? DevelText::MatchLayoutDirection::LOCALE : DevelText::MatchLayoutDirection::CONTENTS); break; } case Toolkit::DevelTextEditor::Property::MAX_LENGTH: @@ -1119,7 +1118,7 @@ Property::Value TextEditor::GetProperty(BaseObject* object, Property::Index inde } case Toolkit::DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION: { - value = impl.mController->IsMatchSystemLanguageDirection(); + value = impl.mController->GetMatchLayoutDirection() != DevelText::MatchLayoutDirection::CONTENTS; break; } case Toolkit::DevelTextEditor::Property::MAX_LENGTH: @@ -1376,6 +1375,8 @@ void TextEditor::OnInitialize() Dali::LayoutDirection::Type layoutDirection = static_cast(stage.GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get()); mController->SetLayoutDirection(layoutDirection); + self.LayoutDirectionChangedSignal().Connect(this, &TextEditor::OnLayoutDirectionChanged); + // Forward input events to controller EnableGestureDetection(static_cast(GestureType::TAP | GestureType::PAN | GestureType::LONG_PRESS)); GetTapGestureDetector().SetMaximumTapsRequired(2); @@ -1501,15 +1502,8 @@ void TextEditor::OnRelayout(const Vector2& size, RelayoutContainer& container) Vector2 contentSize(size.x - (padding.start + padding.end), size.y - (padding.top + padding.bottom)); // Support Right-To-Left of padding - Dali::LayoutDirection::Type layoutDirection; - if(mController->IsMatchSystemLanguageDirection()) - { - layoutDirection = static_cast(DevelWindow::Get(self).GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get()); - } - else - { - layoutDirection = static_cast(self.GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get()); - } + Dali::LayoutDirection::Type layoutDirection = mController->GetLayoutDirection(self); + if(Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection) { std::swap(padding.start, padding.end); @@ -2172,6 +2166,11 @@ void TextEditor::SetEditable(bool editable) } } +void TextEditor::OnLayoutDirectionChanged(Actor actor, LayoutDirection::Type type) +{ + mController->ChangedLayoutDirection(); +} + TextEditor::TextEditor() : Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT)), mAnimationPeriod(0.0f, 0.0f),