diff --git a/src/gui/filedetails/ShareeSearchField.qml b/src/gui/filedetails/ShareeSearchField.qml index 6017eea72f559..39139c0c3ad9e 100644 --- a/src/gui/filedetails/ShareeSearchField.qml +++ b/src/gui/filedetails/ShareeSearchField.qml @@ -42,7 +42,7 @@ TextField { readonly property double iconsScaleFactor: 0.6 function triggerSuggestionsVisibility() { - shareeListView.count > 0 ? suggestionsPopup.open() : suggestionsPopup.close(); + !contextMenu.opened && shareeListView.count > 0 ? suggestionsPopup.open() : suggestionsPopup.close(); } placeholderText: enabled ? qsTr("Search for users or groups…") : qsTr("Sharing is not available for this folder") @@ -94,6 +94,10 @@ TextField { } } } + onPressed: function(mouse) { + if (mouse.button !== Qt.RightButton) return; + contextMenu.popup(mouse.x, mouse.y); + } leftPadding: searchIcon.width + searchIcon.anchors.leftMargin + horizontalPaddingOffset rightPadding: clearTextButton.width + clearTextButton.anchors.rightMargin + horizontalPaddingOffset @@ -165,6 +169,23 @@ TextField { } } + Menu { + id: contextMenu + MenuItem { + text: qsTr("Cut") + onTriggered: root.cut() + } + MenuItem { + text: qsTr("Copy") + onTriggered: root.copy() + } + MenuItem { + text: qsTr("Paste") + onTriggered: root.paste() + } + } + + Popup { id: suggestionsPopup