From 390af608993e1306076d11d06922649dd4aedbda Mon Sep 17 00:00:00 2001 From: "v.cebollada" Date: Mon, 24 Aug 2015 13:48:53 +0900 Subject: [PATCH] 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 --- dali-toolkit/internal/text/text-controller.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 ); } -- 2.7.4