X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller.cpp;h=eb0220228fbeb207437247e3ef073b6438598485;hb=d6f58f1070d7dcf950a2517cabe91828178a4788;hp=ef10a3f5fab98943c7bb606213af94d5d41fc2ea;hpb=fcbd0fc67ae67b5f068f09483a765d4afa7bd52b;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 ef10a3f..eb02202 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -404,11 +404,10 @@ void Controller::UpdateAfterFontChange( std::string& newDefaultFont ) { DALI_LOG_INFO( gLogFilter, Debug::Concise, "Controller::UpdateAfterFontChange"); - ClearFontData(); - if ( !mImpl->mUserDefinedFontFamily ) // If user defined font then should not update when system font changes { DALI_LOG_INFO( gLogFilter, Debug::Concise, "Controller::UpdateAfterFontChange newDefaultFont(%s)\n", newDefaultFont.c_str() ); + ClearFontData(); mImpl->mFontDefaults->mFontDescription.family = newDefaultFont; mImpl->UpdateModel( ALL_OPERATIONS ); mImpl->QueueModifyEvent( ModifyEvent::TEXT_REPLACED ); @@ -784,18 +783,18 @@ void Controller::ProcessModifyEvents() for( unsigned int i=0; iIsShowingPlaceholderText() ) @@ -1256,7 +1255,7 @@ void Controller::KeyboardFocusLostEvent() { mImpl->ChangeState( EventData::INACTIVE ); - if( mImpl->IsShowingPlaceholderText() ) + if( !mImpl->IsShowingRealText() ) { // Revert to regular placeholder-text when not editing ShowPlaceholderText(); @@ -1523,6 +1522,11 @@ void Controller::TapEvent( unsigned int tapCount, float x, float y ) else if( EventData::EDITING != mImpl->mEventData->mState && EventData::EDITING_WITH_GRAB_HANDLE != mImpl->mEventData->mState ) { + if( mImpl->IsShowingPlaceholderText() && ! mImpl->IsFocusedPlaceholderAvailable() ) + { + // Hide placeholder text + ResetText(); + } // Show cursor on first tap mImpl->ChangeState( EventData::EDITING ); relayoutNeeded = true; @@ -1606,6 +1610,9 @@ void Controller::LongPressEvent( Gesture::State state, float x, float y ) } else { + // Reset the imf manger to commit the pre-edit before selecting the text. + mImpl->ResetImfManager(); + SelectEvent( x, y, false ); } } @@ -1810,6 +1817,7 @@ ImfManager::ImfCallbackData Controller::OnImfEvent( ImfManager& imfManager, cons case ImfManager::COMMIT: { InsertText( imfEvent.predictiveString, Text::Controller::COMMIT ); + update=true; requestRelayout = true; break; } @@ -1903,11 +1911,10 @@ bool Controller::BackspaceKeyEvent() if( removed ) { - // This is to reset the virtual keyboard to Upper-case - if( 0u == mImpl->mLogicalModel->mText.Count() ) - { - NotifyImfManager(); - } + DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p DALI_KEY_BACKSPACE RemovedText\n", this ); + // Notifiy the IMF manager after text changed + // Automatic Upper-case and restarting prediction on an existing word require this. + NotifyImfManager(); if( 0u != mImpl->mLogicalModel->mText.Count() || !mImpl->IsPlaceholderAvailable() )