Fixed overlapping issue between cursor and placeholder text 33/47933/1
authorsuhyung Eom <suhyung.eom@samsung.com>
Thu, 10 Sep 2015 07:14:02 +0000 (16:14 +0900)
committersuhyung Eom <suhyung.eom@samsung.com>
Thu, 10 Sep 2015 07:15:03 +0000 (16:15 +0900)
Signed-off-by: suhyung Eom <suhyung.eom@samsung.com>
Change-Id: Ia3d3ca2b583f36e8c9357150ac4ba0af4026a0a9

dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp

index 2936d4d..8ada007 100644 (file)
@@ -290,6 +290,14 @@ struct Controller::Impl
     return ( mEventData && mEventData->mIsShowingPlaceholderText );
   }
 
+  /**
+   * @brief Helper to check whether active place-holder text is available.
+   */
+  bool IsFocusedPlaceholderAvailable() const
+  {
+    return ( mEventData && !mEventData->mPlaceholderTextActive.empty() );
+  }
+
   bool IsShowingRealText() const
   {
     return ( !IsShowingPlaceholderText() &&
index ef10a3f..83c81a3 100644 (file)
@@ -1256,7 +1256,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 +1523,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;