From c9719f44dc913dd362a93d11b80c2b2dcc672dc2 Mon Sep 17 00:00:00 2001 From: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> Date: Fri, 17 Jan 2020 16:30:27 +0100 Subject: [PATCH] Fix hover property wrongly placed in button, not MouseArea Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> --- src/gui/tray/UserLine.qml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/gui/tray/UserLine.qml b/src/gui/tray/UserLine.qml index afa0a28f6..357be6005 100644 --- a/src/gui/tray/UserLine.qml +++ b/src/gui/tray/UserLine.qml @@ -20,22 +20,25 @@ MenuItem { display: AbstractButton.IconOnly flat: true - onHoveredChanged: { - accountStateIndicatorBackground.color = (containsMouse ? "#f6f6f6" : "white") + MouseArea { + anchors.fill: parent + hoverEnabled: true + onContainsMouseChanged: { + accountStateIndicatorBackground.color = (containsMouse ? "#f6f6f6" : "white") + } + onClicked: { + if (!isCurrentUser) { + userModelBackend.switchCurrentUser(id) + } else { + accountMenu.close() + } + } } background: Rectangle { color: "transparent" } - onClicked: { - if (!isCurrentUser) { - userModelBackend.switchCurrentUser(id) - } else { - accountMenu.close() - } - } - RowLayout { id: accountControlRowLayout height: accountButton.height