(TextInput) Don't show cut and copy buttons if text not selected
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / text-input / text-input-impl.cpp
index 9b17229..d2c6c86 100644 (file)
@@ -3793,7 +3793,7 @@ void TextInput::ShowPopupCutCopyPaste()
     mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsSelectAll, true );
   }
 
-  if ( !mStyledText.empty() )
+  if ( !mStyledText.empty() && IsTextSelected() )
   {
     mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsCopy, true );
     mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsCut, true );
@@ -3820,7 +3820,7 @@ void TextInput::SetUpPopupSelection( bool showCutButton )
   {
     mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsSelectAll, true );
     mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsSelect, true );
-    mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsCut, showCutButton );
+    mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsCut, ( showCutButton && IsTextSelected() ) );
   }
   // if clipboard has valid contents then offer paste option
   if( mClipboard && mClipboard.NumberOfItems() )