diff --git a/ui/shared/Input.qml b/ui/shared/Input.qml index 0515d6e5cc..8833d08755 100644 --- a/ui/shared/Input.qml +++ b/ui/shared/Input.qml @@ -1,5 +1,8 @@ import QtQuick 2.13 import QtQuick.Controls 2.13 + +import StatusQ.Popups 0.1 + import "../imports" import "../shared/status" import "." @@ -102,6 +105,19 @@ Item { } onEditingFinished: inputBox.editingFinished(inputBox.text) onTextEdited: inputBox.textEdited(inputBox.text) + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.RightButton | Qt.LeftButton + onClicked: { + if((mouse.button === Qt.RightButton) && inputValue.canPaste) { + rightClickContextMenu.popup() + } + else { + inputValue.forceActiveFocus(Qt.MouseFocusReason) + } + } + } } SVGImage { @@ -186,6 +202,22 @@ Item { color: validationErrorColor wrapMode: TextEdit.Wrap } + + StatusPopupMenu { + id: rightClickContextMenu + + StatusMenuItem { + enabled: inputValue.canPaste + text: qsTrId("Paste") + onTriggered: { + inputValue.paste() + } + } + + onClosed: { + inputValue.forceActiveFocus(Qt.MouseFocusReason) + } + } } /*##^##