Fixed clipboard disappearing issue on selection 69/68969/1
authorsuhyung Eom <suhyung.eom@samsung.com>
Tue, 10 May 2016 23:14:14 +0000 (08:14 +0900)
committersuhyung Eom <suhyung.eom@samsung.com>
Tue, 10 May 2016 23:15:11 +0000 (08:15 +0900)
Signed-off-by: suhyung Eom <suhyung.eom@samsung.com>
Change-Id: I10a4d3cde28b196eb306d08c0d4a7c85976cc1c4

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

index c3b2346..e77f00d 100644 (file)
@@ -1390,12 +1390,17 @@ void Controller::Impl::ShowClipboard()
 
 void Controller::Impl::HideClipboard()
 {
-  if( mClipboard )
+  if( mClipboard && mClipboardHideEnabled )
   {
     mClipboard.HideClipboard();
   }
 }
 
+void Controller::Impl::SetClipboardHideEnable(bool enable)
+{
+  mClipboardHideEnabled = enable;
+}
+
 bool Controller::Impl::CopyStringToClipboard( std::string& source )
 {
   //Send string to clipboard
index 99b0c69..ce8a291 100644 (file)
@@ -300,7 +300,8 @@ struct Controller::Impl
     mOperationsPending( NO_OPERATION ),
     mMaximumNumberOfCharacters( 50u ),
     mRecalculateNaturalSize( true ),
-    mMarkupProcessorEnabled( false )
+    mMarkupProcessorEnabled( false ),
+    mClipboardHideEnabled( true )
   {
     mLogicalModel = LogicalModel::New();
     mVisualModel  = VisualModel::New();
@@ -523,6 +524,8 @@ struct Controller::Impl
 
   void HideClipboard();
 
+  void SetClipboardHideEnable(bool enable);
+
   bool CopyStringToClipboard( std::string& source );
 
   void SendSelectionToClipboard( bool deleteAfterSending );
@@ -655,6 +658,7 @@ public:
 
   bool mRecalculateNaturalSize:1;          ///< Whether the natural size needs to be recalculated.
   bool mMarkupProcessorEnabled:1;          ///< Whether the mark-up procesor is enabled.
+  bool mClipboardHideEnabled:1;           ///< Whether the ClipboardHide function work or not
 };
 
 } // namespace Text
index c733384..3a211e1 100644 (file)
@@ -2335,8 +2335,13 @@ void Controller::PasteClipboardItemEvent()
   // Commit the current pre-edit text; the contents of the clipboard should be appended
   mImpl->ResetImfManager();
 
+  // Temporary disable hiding clipboard
+  mImpl->SetClipboardHideEnable( false );
+
   // Paste
   PasteText( stringToPaste );
+
+  mImpl->SetClipboardHideEnable( true );
 }
 
 void Controller::TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Buttons button )