[Tizen] Fix behaviour when PreeditStyle is REVERSE
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-editor-impl.cpp
index e216301..bd924a4 100644 (file)
@@ -1309,6 +1309,12 @@ void TextEditor::OnRelayout(const Vector2& size, RelayoutContainer& container)
     mActiveLayer.SetProperty(Actor::Property::POSITION, Vector2(padding.start, padding.top));
   }
 
+  // If there is text changed, callback is called.
+  if(mTextChanged)
+  {
+    EmitTextChangedSignal();
+  }
+
   const Text::Controller::UpdateTextType updateTextType = mController->Relayout(contentSize, layoutDirection);
 
   if((Text::Controller::NONE_UPDATED != updateTextType) ||
@@ -1328,14 +1334,6 @@ void TextEditor::OnRelayout(const Vector2& size, RelayoutContainer& container)
     }
 
     RenderText(updateTextType);
-
-    // If there is text changed, callback is called.
-    if(mTextChanged)
-    {
-      Dali::Toolkit::TextEditor handle(GetOwner());
-      mTextChangedSignal.Emit(handle);
-      mTextChanged = false;
-    }
   }
 
   // The text-editor emits signals when the input style changes. These changes of style are
@@ -1516,9 +1514,23 @@ void TextEditor::RequestTextRelayout()
   RelayoutRequest();
 }
 
-void TextEditor::TextChanged()
+void TextEditor::TextChanged(bool immediate)
 {
-  mTextChanged = true;
+  if(immediate) // Emits TextChangedSignal immediately
+  {
+    EmitTextChangedSignal();
+  }
+  else
+  {
+    mTextChanged = true;
+  }
+}
+
+void TextEditor::EmitTextChangedSignal()
+{
+  Dali::Toolkit::TextEditor handle(GetOwner());
+  mTextChangedSignal.Emit(handle);
+  mTextChanged = false;
 }
 
 void TextEditor::MaxLengthReached()
@@ -1618,6 +1630,18 @@ Uint32Pair TextEditor::GetTextSelectionRange() const
   return range;
 }
 
+void TextEditor::GetControlBackgroundColor(Vector4& color) const
+{
+  Property::Value propValue = Self().GetProperty(Toolkit::Control::Property::BACKGROUND);
+  Property::Map*  resultMap = propValue.GetMap();
+
+  Property::Value* colorValue = nullptr;
+  if(resultMap && (colorValue = resultMap->Find(ColorVisual::Property::MIX_COLOR)))
+  {
+    colorValue->Get(color);
+  }
+}
+
 void TextEditor::UpdateScrollBar()
 {
   using namespace Dali;