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

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