From 1f3aa0bbd540d71d9885a53d42f379bb67ff822e 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 ++++++++- src/StatusQ/Components/StatusListItem.qml | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/StatusQ/Components/StatusChatListCategory.qml b/src/StatusQ/Components/StatusChatListCategory.qml index 076a850a..d31d42fb 100644 --- a/src/StatusQ/Components/StatusChatListCategory.qml +++ b/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/src/StatusQ/Components/StatusListItem.qml b/src/StatusQ/Components/StatusListItem.qml index f1b85a0a..8f92cf02 100644 --- a/src/StatusQ/Components/StatusListItem.qml +++ b/src/StatusQ/Components/StatusListItem.qml @@ -48,6 +48,7 @@ Rectangle { anchors.fill: parent cursorShape: Qt.PointingHandCursor + acceptedButtons: Qt.LeftButton | Qt.RightButton hoverEnabled: true Loader {