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/Input.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'components/Input.qml') diff --git a/components/Input.qml b/components/Input.qml index 33601d88..b33a821e 100644 --- a/components/Input.qml +++ b/components/Input.qml @@ -48,9 +48,16 @@ TextField { MoneroComponents.ContextMenu { cursorShape: Qt.IBeamCursor + onCut: textField.cut(); + onCopy: textField.copy(); onPaste: { - textField.clear(); + var previoustextFieldLength = textField.length + var previousCursorPosition = textField.cursorPosition; textField.paste(); + textField.forceActiveFocus() + textField.cursorPosition = previousCursorPosition + (textField.length - previoustextFieldLength); } + onRemove: textField.remove(selectionStart, selectionEnd); + onSelectAll: textField.selectAll(); } } -- cgit v1.2.3