From d3780abe33f8e78125eda7546fa2e14a4cfc4fab Mon Sep 17 00:00:00 2001 From: rating89us <45968869+rating89us@users.noreply.github.com> Date: Sun, 5 Sep 2021 15:36:38 +0200 Subject: ContextMenu: add Cut, Copy, Delete and Select All --- components/InputMulti.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'components/InputMulti.qml') diff --git a/components/InputMulti.qml b/components/InputMulti.qml index ddbd5552..5d530b1d 100644 --- a/components/InputMulti.qml +++ b/components/InputMulti.qml @@ -71,9 +71,16 @@ TextArea { MoneroComponents.ContextMenu { cursorShape: Qt.IBeamCursor + onCut: textArea.cut(); + onCopy: textArea.copy(); onPaste: { - textArea.clear(); + var previoustextFieldLength = textArea.length + var previousCursorPosition = textArea.cursorPosition; textArea.paste(); + textArea.forceActiveFocus() + textArea.cursorPosition = previousCursorPosition + (textArea.length - previoustextFieldLength); } + onRemove: textArea.remove(selectionStart, selectionEnd); + onSelectAll: textArea.selectAll(); } } -- cgit v1.2.3