From b0cedbeefae19607e99abfe3084595720e364771 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Fri, 18 Oct 2024 11:47:54 +0800 Subject: [PATCH] Add a context menu for the sharees search field Signed-off-by: Claudio Cambra --- src/gui/filedetails/ShareeSearchField.qml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/gui/filedetails/ShareeSearchField.qml b/src/gui/filedetails/ShareeSearchField.qml index 6017eea72f559..e4443f5fb9c91 100644 --- a/src/gui/filedetails/ShareeSearchField.qml +++ b/src/gui/filedetails/ShareeSearchField.qml @@ -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