2
0
mirror of synced 2025-02-12 22:56:48 +00:00
Pascal Precht a6262f0a34 feat(StatusChatList): introduce popupMenu property
Chat list items can open a context on right click as well, so `StatusChatList`
needs to provide an API for users to pass down a `StatusPopupMenu` accordingly.

This is now possible with a dedicated `popupMenu` proporty that can be
used as follows:

```qml
StatusChatList {
    ...
    popupMenu: StatusPopupMenu {

        property string chatId

        openHandler: function () {
            ...
        }

        StatusMenuItem {
            ...
        }
        ...
    }
}
```

As will all `popupMenu` properties in StatusQ component, having this explicit API
option enables us to have control over how triggering components (in this case chat
list items) behave when they open a context menu (e.g. keeping them highlighted as long
as the menu is active).

When defining a `chatId` property, `StatusChatList` will hydrate it with the id of
the chat list item that has triggered the menu.

If there's more logic to be executed upon opening the menu, `openHandler` serves
as a hook similar to other popup menus. Inside the hook, users have access to the
specific `chatId`.

Closes #171
2021-06-24 16:01:47 +02:00
..
2021-05-05 07:55:43 +02:00
2021-05-05 07:55:43 +02:00
2021-05-05 07:55:43 +02:00
2021-05-05 07:55:43 +02:00
2021-06-21 13:04:34 +02:00
2021-06-21 13:04:34 +02:00
2021-06-21 13:04:34 +02:00