aboutsummaryrefslogtreecommitdiff
path: root/components/Input.qml
diff options
context:
space:
mode:
authorrating89us <45968869+rating89us@users.noreply.github.com>2021-09-05 15:36:38 +0200
committerrating89us <45968869+rating89us@users.noreply.github.com>2021-09-05 15:52:51 +0200
commitd3780abe33f8e78125eda7546fa2e14a4cfc4fab (patch)
tree3c09afb67eed4f0be74c0abfa18b16d626f04418 /components/Input.qml
parent113efbfdf093401d3044ce370b7039ea8cc596bf (diff)
downloadmonzero-gui-d3780abe33f8e78125eda7546fa2e14a4cfc4fab.tar.gz
monzero-gui-d3780abe33f8e78125eda7546fa2e14a4cfc4fab.tar.xz
monzero-gui-d3780abe33f8e78125eda7546fa2e14a4cfc4fab.zip
ContextMenu: add Cut, Copy, Delete and Select All
Diffstat (limited to 'components/Input.qml')
-rw-r--r--components/Input.qml9
1 files changed, 8 insertions, 1 deletions
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();
}
}