diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2024-03-10 22:21:40 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2024-03-10 22:21:40 +0100 |
commit | f25a1b5c36967f1138f6dfb45a0e69ee52769d78 (patch) | |
tree | d326a1e7d2ca7c565347190dc8dfb6fc3897e19d /resources/qml/TimelineBubbleMessageStyle.qml | |
parent | eaf9ae315c3ee9fd05cc84c4419bad2bc3681e5d (diff) |
Work around the duplicate right click menus on KDE
Diffstat (limited to 'resources/qml/TimelineBubbleMessageStyle.qml')
-rw-r--r-- | resources/qml/TimelineBubbleMessageStyle.qml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/resources/qml/TimelineBubbleMessageStyle.qml b/resources/qml/TimelineBubbleMessageStyle.qml index 2e038131..3b0f2d94 100644 --- a/resources/qml/TimelineBubbleMessageStyle.qml +++ b/resources/qml/TimelineBubbleMessageStyle.qml @@ -317,6 +317,23 @@ TimelineEvent { } }, + Item { + // We need this item to grab events, that otherwise would go to the TextArea in the main item. If we don't have this, it would trigger a right click menu on KDE... + // https://invent.kde.org/frameworks/qqc2-desktop-style/-/blob/9d71fe874186009f76d392e203d9fa25a49f8be7/org.kde.desktop/TextArea.qml#L55 + + anchors.fill: gridContainer + anchors.topMargin: replyRow.height + TapHandler { + + acceptedButtons: Qt.RightButton + acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad + gesturePolicy: TapHandler.ReleaseWithinBounds + + onSingleTapped: (event) => { + messageContextMenu.show(wrapper.eventId, wrapper.threadId, wrapper.type, wrapper.isSender, wrapper.isEncrypted, wrapper.isEditable, wrapper.main.hoveredLink, wrapper.main.copyText); + } + } + }, Reactions { id: reactionRow |