From aa9c2b45a6be065cb940c2cc19e30cd7a6fabfa2 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 14 Nov 2024 17:20:31 +0800 Subject: [PATCH] Wrap the instantiated userLine components in a menu item Get proper handling of hover and so on this way Signed-off-by: Claudio Cambra --- src/gui/tray/MainWindow.qml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gui/tray/MainWindow.qml b/src/gui/tray/MainWindow.qml index 5aa9ce9fd..34ab12ad9 100644 --- a/src/gui/tray/MainWindow.qml +++ b/src/gui/tray/MainWindow.qml @@ -303,12 +303,17 @@ ApplicationWindow { Instantiator { id: userLineInstantiator model: UserModel - delegate: UserLine { - onShowUserStatusSelector: { - userStatusDrawer.openUserStatusDrawer(model.index); - accountMenu.close(); + delegate: MenuItem { + implicitHeight: instantiatedUserLine.height + UserLine { + 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) onObjectRemoved: accountMenu.removeItem(object)