Просмотр исходного кода

Get rid of ncBlueHover

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>
Kevin Ottens 5 лет назад
Родитель
Сommit
0e9efe728a
2 измененных файлов с 10 добавлено и 7 удалено
  1. 10 6
      src/gui/tray/Window.qml
  2. 0 1
      theme/Style/Style.qml

+ 10 - 6
src/gui/tray/Window.qml

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

+ 0 - 1
theme/Style/Style.qml

@@ -6,7 +6,6 @@ import QtQuick 2.5
 QtObject {
     // Colors
     property color ncBlue:      "#0082c9"
-    property color ncBlueHover: "#009dd9"
     property color lightHover:  "#f7f7f7"
     property color menuBorder:  "#bdbdbd"