ContextMenu: add Cut, Copy, Delete and Select All

This commit is contained in:
rating89us
2021-09-05 15:36:38 +02:00
parent 113efbfdf0
commit d3780abe33
4 changed files with 73 additions and 11 deletions

View File

@@ -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();
}
}