fix(StatusChatListCategory): emit original mouse event data in clicked signal

This fixes a bug that was introduced in 01da750899 with a breaking change
where `StatusChatListCategoryItem`'s `clicked` signal would no longer receive
a `mouse` event object.

The reason this is happening is because we've introduced a new `clicked` signal
on `StatusListItem`. The idea was to rely on that within `StatusChatListCategoryItem`,
however, we didn't take into account that the new `clicked` signal in `StatusListItem`
doesn't emit a `mouse` event object.

To fix this issue could either reintroduce the custom `clicked` handler on
`StatusChatListCategoryItem`, or listen to the original `sensor.onClicked` and
`onTitleClicked` signals exposed by `StatusListItem` instead, ensuring the required
`mouse` event data exists.

Fixes #333
This commit is contained in:
Pascal Precht 2021-08-20 12:30:18 +02:00 committed by Michał Cieślak
parent 85ee81cfa3
commit 591fbdbd4f
1 changed files with 3 additions and 1 deletions

View File

@ -34,7 +34,7 @@ Column {
showMenuButton: showActionButtons && !!statusChatListCategory.popupMenu
onClicked: {
sensor.onClicked: {
if (mouse.button === Qt.RightButton && showActionButtons && !!statusChatListCategory.popupMenu) {
highlighted = true
popupMenuSlot.item.popup(mouse.x + 4, mouse.y + 6)
@ -42,6 +42,8 @@ Column {
}
statusChatListCategory.opened = !opened
}
onTitleClicked: statusChatListCategory.opened = !opened
onToggleButtonClicked: statusChatListCategory.opened = !opened
onMenuButtonClicked: {
highlighted = true