Wrap the instantiated userLine components in a menu item

Get proper handling of hover and so on this way

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-11-14 17:20:31 +08:00
parent 2483d2cfc6
commit aa9c2b45a6
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -303,12 +303,17 @@ ApplicationWindow {
Instantiator { Instantiator {
id: userLineInstantiator id: userLineInstantiator
model: UserModel model: UserModel
delegate: UserLine { delegate: MenuItem {
onShowUserStatusSelector: { implicitHeight: instantiatedUserLine.height
userStatusDrawer.openUserStatusDrawer(model.index); UserLine {
accountMenu.close(); id: instantiatedUserLine
width: parent.width
onShowUserStatusSelector: {
userStatusDrawer.openUserStatusDrawer(model.index);
accountMenu.close();
}
onClicked: UserModel.currentUserId = model.index;
} }
onClicked: UserModel.currentUserId = model.index;
} }
onObjectAdded: accountMenu.insertItem(index, object) onObjectAdded: accountMenu.insertItem(index, object)
onObjectRemoved: accountMenu.removeItem(object) onObjectRemoved: accountMenu.removeItem(object)