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 Michał Cieślak
parent 30956a757d
commit afa4739df6
2 changed files with 9 additions and 1 deletions

View File

@ -30,7 +30,14 @@ Column {
title: statusChatListCategory.name title: statusChatListCategory.name
opened: statusChatListCategory.opened 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 onToggleButtonClicked: statusChatListCategory.opened = !opened
onMenuButtonClicked: { onMenuButtonClicked: {
highlighted = true highlighted = true

View File

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