From 1205231707ae82cfcfc2cc39679651f33028a883 Mon Sep 17 00:00:00 2001
From: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
Date: Wed, 1 Mar 2023 08:56:13 -0300
Subject: [PATCH] participantoverlay: fix buttons hover color

Change-Id: I981d3db41a2a2fecbece83d1d84f63c48de82888
GitLab: #996
---
 src/app/commoncomponents/PushButton.qml              |  6 ++++++
 src/app/mainview/components/ParticipantOverlay.qml   |  1 -
 .../mainview/components/ParticipantOverlayButton.qml | 12 +++++++++---
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/app/commoncomponents/PushButton.qml b/src/app/commoncomponents/PushButton.qml
index 5922449af..55f86cab6 100644
--- a/src/app/commoncomponents/PushButton.qml
+++ b/src/app/commoncomponents/PushButton.qml
@@ -83,6 +83,8 @@ AbstractButton {
     hoverEnabled: true
     focusPolicy: Qt.TabFocus
 
+    property bool forceHovered:  false
+
     Accessible.role: Accessible.Button
     Accessible.name: buttonText
     Accessible.description: toolTipText
@@ -163,6 +165,10 @@ AbstractButton {
                 name: "hovered"; when: hovered || root.focus
                 PropertyChanges { target: background; color: hoveredColor }
             },
+            State {
+                name: "forceHovered"; when: forceHovered || root.focus
+                PropertyChanges { target: background; color: hoveredColor }
+            },
             State {
                 name: "normal"; when: !hovered && ! checked
                 PropertyChanges { target: background; color: normalColor }
diff --git a/src/app/mainview/components/ParticipantOverlay.qml b/src/app/mainview/components/ParticipantOverlay.qml
index 2aa3d9cba..91d949022 100644
--- a/src/app/mainview/components/ParticipantOverlay.qml
+++ b/src/app/mainview/components/ParticipantOverlay.qml
@@ -403,7 +403,6 @@ Item {
                 }
             }
 
-
             Rectangle {
                 id: alertMessage
 
diff --git a/src/app/mainview/components/ParticipantOverlayButton.qml b/src/app/mainview/components/ParticipantOverlayButton.qml
index ecacd68bc..ea62b2beb 100644
--- a/src/app/mainview/components/ParticipantOverlayButton.qml
+++ b/src/app/mainview/components/ParticipantOverlayButton.qml
@@ -43,8 +43,8 @@ PushButton {
             top: parent.bottom
             topMargin: isBarLayout? 6 : 2
         }
-        color : isBarLayout? JamiTheme.darkGreyColorOpacity
-                           : "transparent"
+        color : isBarLayout ? JamiTheme.darkGreyColorOpacity
+                            : "transparent"
         visible: hover.hovered && !isSmall
         radius: 2
 
@@ -56,9 +56,15 @@ PushButton {
             font.pointSize: JamiTheme.tinyFontSize
         }
     }
+
     Item {
         anchors.fill: parent
 
-        HoverHandler { id: hover }
+        HoverHandler {
+            id: hover
+            onHoveredChanged: {
+                root.forceHovered = hover.hovered
+            }
+        }
     }
 }
-- 
GitLab