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-field-impl.cpp;h=2b76083bd815dc1d4a3154407c7bac199cb49c29;hp=95e4765f71b6860917bba8dee949e15dbb77f32e;hb=309dec1120f1f4ff528f615d3607da8422464107;hpb=7098ad0a9a657b68b37d5fd759662a2d08b47433 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 95e4765..2b76083 100755 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -132,6 +132,7 @@ 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 ) @@ -785,6 +786,14 @@ 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 } @@ -1200,6 +1209,14 @@ 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 } @@ -1286,6 +1303,11 @@ void TextField::OnInitialize() mController->SetNoTextDoubleTapAction( Controller::NoTextTap::HIGHLIGHT ); mController->SetNoTextLongPressAction( Controller::NoTextTap::HIGHLIGHT ); + // Sets layoutDirection value + Dali::Stage stage = Dali::Stage::GetCurrent(); + Dali::LayoutDirection::Type layoutDirection = static_cast( stage.GetRootLayer().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get() ); + mController->SetLayoutDirection( layoutDirection ); + // Forward input events to controller EnableGestureDetection( static_cast( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) ); GetTapGestureDetector().SetMaximumTapsRequired( 2 ); @@ -1397,7 +1419,7 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container ) mActiveLayer.SetPosition( padding.start, padding.top ); } - const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize ); + const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize, layoutDirection ); if( ( Text::Controller::NONE_UPDATED != updateTextType ) || !mRenderer )