Merge "Fix for underlined text." into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 20 Aug 2015 13:22:12 +0000 (06:22 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 20 Aug 2015 13:22:13 +0000 (06:22 -0700)
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 3da7138..7dd88e4 100644 (file)
@@ -1709,7 +1709,7 @@ void Controller::Impl::UpdateCursorPosition()
     return;
   }
 
-  if( IsShowingPlaceholderText() )
+  if( IsShowingPlaceholderText() || ( 0u == mLogicalModel->mText.Count() ) )
   {
     // Do not want to use the place-holder text to set the cursor position.
 
index ffc8aff..25ff08d 100644 (file)
@@ -329,7 +329,7 @@ bool Controller::RemoveText( int cursorOffset, int numberOfChars )
   DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::RemoveText %p mText.Count() %d cursor %d cursorOffset %d numberOfChars %d\n",
                  this, mImpl->mLogicalModel->mText.Count(), mImpl->mEventData->mPrimaryCursorPosition, cursorOffset, numberOfChars );
 
-  if( ! mImpl->IsShowingPlaceholderText() )
+  if( !mImpl->IsShowingPlaceholderText() )
   {
     // Delete at current cursor position
     Vector<Character>& currentText = mImpl->mLogicalModel->mText;
@@ -785,7 +785,14 @@ void Controller::TextDeletedEvent()
                                                            REORDER );
 
   // Queue a cursor reposition event; this must wait until after DoRelayout()
-  mImpl->mEventData->mScrollAfterDelete = true;
+  if( 0u == mImpl->mLogicalModel->mText.Count() )
+  {
+    mImpl->mEventData->mUpdateCursorPosition = true;
+  }
+  else
+  {
+    mImpl->mEventData->mScrollAfterDelete = true;
+  }
 }
 
 bool Controller::DoRelayout( const Size& size,
@@ -1160,6 +1167,13 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
       // Menu/Home key behaviour does not allow edit mode to resume like Power key
       // Avoids calling the InsertText() method which can delete selected text
     }
+    else if( Dali::DALI_KEY_SHIFT_LEFT == keyCode )
+    {
+      // DALI_KEY_SHIFT_LEFT is the key code for the Left Shift. It's sent (by the imf?) when the predictive text is enabled
+      // and a character is typed after the type of a upper case latin character.
+
+      // Do nothing.
+    }
     else
     {
       DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p keyString %s\n", this, keyString.c_str() );
@@ -1642,7 +1656,21 @@ ImfManager::ImfCallbackData Controller::OnImfEvent( ImfManager& imfManager, cons
     }
     case ImfManager::DELETESURROUNDING:
     {
-      RemoveText( imfEvent.cursorOffset, imfEvent.numberOfChars );
+      update = RemoveText( imfEvent.cursorOffset, imfEvent.numberOfChars );
+
+      if( update )
+      {
+        if( 0u != mImpl->mLogicalModel->mText.Count() ||
+            !mImpl->IsPlaceholderAvailable() )
+        {
+          mImpl->QueueModifyEvent( ModifyEvent::TEXT_DELETED );
+        }
+        else
+        {
+          ShowPlaceholderText();
+          mImpl->mEventData->mUpdateCursorPosition = true;
+        }
+      }
       requestRelayout = true;
       break;
     }
index 1f034fd..c58a5b4 100644 (file)
@@ -30,8 +30,8 @@ namespace Toolkit
 {
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
-const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 53;
+const unsigned int TOOLKIT_MINOR_VERSION = 1;
+const unsigned int TOOLKIT_MICRO_VERSION = 0;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index c81e760..e41073c 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.0.53
+Version:    1.1.0
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0, BSD-2.0, MIT