From: v.cebollada Date: Mon, 24 Aug 2015 04:48:53 +0000 (+0900) Subject: Fixes the change of style when the text-field grabs the keyboard focus. X-Git-Tag: dali_1.1.1~1^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=390af608993e1306076d11d06922649dd4aedbda;ds=sidebyside Fixes the change of style when the text-field grabs the keyboard focus. * The text field is not in edit mode. - Double tap to select a word. The text-field grabs the focus but it shouldn't change to edit mode, it should select the word. - Tap to edit, tap in a different place to make the grab handle to appear. When the text-field grabs the focus it goes bak to edit mode and the grab handle dissapears. Change-Id: I9dd055df25a8d358b0950faa76ab155affcce7cb Signed-off-by: v.cebollada --- diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index bce657c..2260517 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -1098,7 +1098,12 @@ void Controller::KeyboardFocusGainEvent() if( mImpl->mEventData ) { - mImpl->ChangeState( EventData::EDITING ); + if( ( EventData::INACTIVE == mImpl->mEventData->mState ) || + ( EventData::INTERRUPTED == mImpl->mEventData->mState ) ) + { + mImpl->ChangeState( EventData::EDITING ); + mImpl->mEventData->mUpdateCursorPosition = true; //If editing started without tap event, cursor update must be triggered. + } if( mImpl->IsShowingPlaceholderText() ) { @@ -1106,7 +1111,6 @@ void Controller::KeyboardFocusGainEvent() ShowPlaceholderText(); } - mImpl->mEventData->mUpdateCursorPosition = true; //If editing started without tap event, cursor update must be triggered. mImpl->RequestRelayout(); } } @@ -1192,7 +1196,8 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent ) textChanged = true; } - if ( mImpl->mEventData->mState != EventData::INTERRUPTED && mImpl->mEventData->mState != EventData::INACTIVE ) + if ( ( mImpl->mEventData->mState != EventData::INTERRUPTED ) && + ( mImpl->mEventData->mState != EventData::INACTIVE ) ) { mImpl->ChangeState( EventData::EDITING ); }