X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller.cpp;h=99bed8308cf4a6ea549c370faa25aaba05e2cef3;hb=refs%2Fchanges%2F53%2F38953%2F3;hp=57356d0ef1eb1cc6741ef910d8b7e2c6e1f1b094;hpb=2d2ecb83398d1c811911b8a734fb844a16616636;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index 57356d0..99bed83 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -1122,6 +1122,37 @@ void Controller::TapEvent( unsigned int tapCount, float x, float y ) { DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected TapEvent" ); + if( NULL != mImpl->mEventData ) + { + if( 1u == tapCount ) + { + bool tapDuringEditMode( EventData::EDITING == mImpl->mEventData->mState ); + + mImpl->ChangeState( EventData::EDITING ); + + if( mImpl->IsShowingPlaceholderText() ) + { + // Alternative placeholder-text is used when editing + ShowPlaceholderText(); + } + else if( EventData::EDITING == mImpl->mEventData->mState ) + { + // Grab handle is not shown until a tap is received whilst EDITING + if( tapDuringEditMode ) + { + mImpl->mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true ); + } + mImpl->mEventData->mDecorator->SetPopupActive( false ); + } + } + else if( mImpl->mEventData->mSelectionEnabled && + ( 2u == tapCount ) ) + { + mImpl->ChangeState( EventData::SELECTING ); + } + } + + // Handles & cursors must be repositioned after Relayout() i.e. after the Model has been updated if( mImpl->mEventData ) { Event event( Event::TAP_EVENT ); @@ -1214,6 +1245,9 @@ void Controller::ShowPlaceholderText() mImpl->mEventData->mIsShowingPlaceholderText = true; + // Cancel previously queued inserts etc. + mImpl->mModifyEvents.clear(); + // Disable handles when showing place-holder text mImpl->mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false ); mImpl->mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );