Add TextField BACKGROUND property and more Preedit style options
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / text-controller.cpp
index c017039..0407147 100755 (executable)
@@ -2143,7 +2143,7 @@ bool Controller::CheckForTextFit( float pointSize, Size& layoutSize )
 void Controller::FitPointSizeforLayout( Size layoutSize )
 {
   const OperationsMask operations  = mImpl->mOperationsPending;
-  if( NO_OPERATION != ( UPDATE_LAYOUT_SIZE & operations ) )
+  if( NO_OPERATION != ( UPDATE_LAYOUT_SIZE & operations ) || mImpl->mTextFitContentSize != layoutSize )
   {
     bool actualellipsis = mImpl->mModel->mElideEnabled;
     float minPointSize = mImpl->mTextFitMinSize;
@@ -2454,6 +2454,9 @@ Toolkit::DevelText::TextDirection::Type Controller::GetTextDirection()
     // Clear the update info. This info will be set the next time the text is updated.
     mImpl->mTextUpdateInfo.Clear();
 
+    // FullRelayoutNeeded should be true because DoRelayout is MAX_FLOAT, MAX_FLOAT.
+    mImpl->mTextUpdateInfo.mFullRelayoutNeeded = true;
+
     mImpl->mUpdateTextDirection = false;
   }
 
@@ -3711,11 +3714,7 @@ bool Controller::RemoveText( int cursorOffset,
       // it means all texts should be removed and all Preedit variables should be initialized.
       if( ( currentText.Count() - numberOfCharacters == 0 ) && ( cursorIndex == 0 ) )
       {
-        if( mImpl->mEventData )
-        {
-          mImpl->mEventData->mPreEditStartPosition = 0;
-          mImpl->mEventData->mPreEditLength = 0;
-        }
+        mImpl->ClearPreEditFlag();
       }
 
       // Updates the text style runs by removing characters. Runs with no characters are removed.
@@ -3732,6 +3731,11 @@ bool Controller::RemoveText( int cursorOffset,
 
       mImpl->mEventData->mScrollAfterDelete = true;
 
+      if( EventData::INACTIVE == mImpl->mEventData->mState )
+      {
+        mImpl->ChangeState( EventData::EDITING );
+      }
+
       DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::RemoveText %p removed %d\n", this, numberOfCharacters );
       removed = true;
     }