From: Carl Schwan Date: Fri, 12 Nov 2021 19:17:15 +0000 (+0100) Subject: More fixes to the menu implementation X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~18^2~108^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d84673376d8e2ae668a3e282e0b98bc9da4aff78;p=nextcloud-desktop.git More fixes to the menu implementation Signed-off-by: Carl Schwan --- diff --git a/src/gui/tray/UserLine.qml b/src/gui/tray/UserLine.qml index c418e3c1f..ecdc6792a 100644 --- a/src/gui/tray/UserLine.qml +++ b/src/gui/tray/UserLine.qml @@ -16,6 +16,7 @@ MenuItem { property variant dialog; property variant comp; + activeFocusOnTab: false signal showUserStatusSelectorDialog(int id) @@ -35,29 +36,19 @@ MenuItem { Accessible.role: Accessible.Button Accessible.name: qsTr("Switch to account") + " " + name - MouseArea { - anchors.fill: parent - hoverEnabled: true - onContainsMouseChanged: { - accountStatusIndicatorBackground.color = (containsMouse ? "#f6f6f6" : "white") - } - onClicked: { - if (!isCurrentUser) { - UserModel.switchCurrentUser(id) - } else { - accountMenu.close() - } - } + onClicked: if (!isCurrentUser) { + UserModel.switchCurrentUser(id) + } else { + accountMenu.close() } - background: Item { height: parent.height width: userLine.menu ? userLine.menu.width : 0 Rectangle { anchors.fill: parent anchors.margins: 1 - color: parent.parent.hovered ? Style.lightHover : "transparent" + color: parent.parent.hovered || parent.parent.visualFocus ? Style.lightHover : "transparent" } } @@ -81,7 +72,7 @@ MenuItem { height: width anchors.bottom: accountAvatar.bottom anchors.right: accountAvatar.right - color: "white" + color: accountButton.hovered || accountButton.visualFocus ? "#f6f6f6" : "white" radius: width*0.5 } Image { @@ -163,21 +154,16 @@ MenuItem { Accessible.name: qsTr("Account actions") Accessible.onPressAction: userMoreButtonMouseArea.clicked() - MouseArea { - id: userMoreButtonMouseArea - anchors.fill: parent - hoverEnabled: true - onClicked: { - if (userMoreButtonMenu.visible) { - userMoreButtonMenu.close() - } else { - userMoreButtonMenu.popup() - } + onClicked: { + if (userMoreButtonMenu.visible) { + userMoreButtonMenu.close() + } else { + userMoreButtonMenu.popup() } } background: Rectangle { - color: userMoreButtonMouseArea.containsMouse ? "grey" : "transparent" + color: userMoreButton.hovered || userMoreButton.visualFocus ? "grey" : "transparent" opacity: 0.2 height: userMoreButton.height - 2 y: userMoreButton.y + 1 @@ -196,7 +182,6 @@ MenuItem { MenuItem { visible: model.isConnected && model.serverHasUserStatus height: visible ? implicitHeight : 0 - text: qsTr("Set status") font.pixelSize: Style.topLinePixelSize hoverEnabled: true diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index 7728ef8f4..96528a61f 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -716,6 +716,7 @@ Window { anchors.right: trayWindowBackground.right anchors.bottom: trayWindowBackground.bottom + activeFocusOnTab: true model: activityModel onShowFileActivity: { openFileActivityDialog(displayPath, absolutePath)