Get rid of ncBlueHover
authorKevin Ottens <kevin.ottens@nextcloud.com>
Wed, 21 Oct 2020 09:24:06 +0000 (11:24 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Wed, 21 Oct 2020 09:24:06 +0000 (11:24 +0200)
Use a similar trick of a semi-transparent rectangle on top when the
mouse area is hovered. This way it will always work whatever is the
background color.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/gui/tray/Window.qml
theme/Style/Style.qml

index 6c33c1c4f3a4884a216844542feef409b1a0fe26..e19bd37bad6df57a41ae43e4841155b986804635 100644 (file)
@@ -143,12 +143,6 @@ Window {
                         anchors.fill:   parent\r
                         hoverEnabled:   Style.hoverEffectsEnabled\r
 \r
-                        // HACK: Imitate Qt hover effect brightness (which is not accessible as property)\r
-                        // so that indicator background also flicks when hovered\r
-                        onContainsMouseChanged: {\r
-                            currentAccountStateIndicatorBackground.color = (containsMouse ? Style.ncBlueHover : Style.ncBlue)\r
-                        }\r
-\r
                         // We call open() instead of popup() because we want to position it\r
                         // exactly below the dropdown button, not the mouse\r
                         onClicked: {\r
@@ -349,6 +343,16 @@ Window {
                                 radius: width*0.5\r
                             }\r
 \r
+                            Rectangle {\r
+                                width: Style.accountAvatarStateIndicatorSize + 2\r
+                                height: width\r
+                                anchors.bottom: currentAccountAvatar.bottom\r
+                                anchors.right: currentAccountAvatar.right\r
+                                color: accountBtnMouseArea.containsMouse ? "white" : "transparent"\r
+                                opacity: 0.2\r
+                                radius: width*0.5\r
+                            }\r
+\r
                             Image {\r
                                 id: currentAccountStateIndicator\r
                                 source: UserModel.isUserConnected(UserModel.currentUserId) ? "qrc:///client/theme/colored/state-ok.svg" : "qrc:///client/theme/colored/state-offline.svg"\r
index 8909c6377de3e0f1b37143c4baf2908220d8b9b1..b13a2b57e63041b97a75d9ff756309d9c1e4aedd 100644 (file)
@@ -6,7 +6,6 @@ import QtQuick 2.5
 QtObject {\r
     // Colors\r
     property color ncBlue:      "#0082c9"\r
-    property color ncBlueHover: "#009dd9"\r
     property color lightHover:  "#f7f7f7"\r
     property color menuBorder:  "#bdbdbd"\r
 \r