feat(StatusChatListItem): accept right clicks

Also triggers the context menu in `StatusChatListCategory`.

Fixes #131
This commit is contained in:
Pascal Precht 2021-06-09 12:09:54 +02:00 committed by Pascal Precht
parent 22eaf6fa99
commit 1f3aa0bbd5
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -48,6 +48,7 @@ Rectangle {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton
hoverEnabled: true
Loader {