mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-13 15:17:45 +00:00
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