From afa4739df61c5ad7b1a0285d775c24db50b5f9e8 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Wed, 9 Jun 2021 12:09:54 +0200 Subject: [PATCH] feat(StatusChatListItem): accept right clicks Also triggers the context menu in `StatusChatListCategory`. Fixes #131 --- .../src/StatusQ/Components/StatusChatListCategory.qml | 9 ++++++++- ui/StatusQ/src/StatusQ/Components/StatusListItem.qml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/StatusQ/src/StatusQ/Components/StatusChatListCategory.qml b/ui/StatusQ/src/StatusQ/Components/StatusChatListCategory.qml index 076a850af6..d31d42fb05 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusChatListCategory.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusChatListCategory.qml @@ -30,7 +30,14 @@ Column { title: statusChatListCategory.name opened: statusChatListCategory.opened - onClicked: statusChatListCategory.opened = !opened + onClicked: { + if (mouse.button === Qt.RightButton) { + highlighted = true + popupMenuSlot.item.popup(mouse.x + 4, mouse.y + 6) + return + } + statusChatListCategory.opened = !opened + } onToggleButtonClicked: statusChatListCategory.opened = !opened onMenuButtonClicked: { highlighted = true diff --git a/ui/StatusQ/src/StatusQ/Components/StatusListItem.qml b/ui/StatusQ/src/StatusQ/Components/StatusListItem.qml index f1b85a0a15..8f92cf02ad 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusListItem.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusListItem.qml @@ -48,6 +48,7 @@ Rectangle { anchors.fill: parent cursorShape: Qt.PointingHandCursor + acceptedButtons: Qt.LeftButton | Qt.RightButton hoverEnabled: true Loader {