[vlc-commits] qml: change foreground based on background in IconToolButton

Prince Gupta git at videolan.org
Thu Jan 14 14:42:30 UTC 2021


vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Wed Dec 23 23:44:08 2020 +0530| [dcd732b4cfbfa8bf8e489f12a9e7b4bd9bb6b922] | committer: Pierre Lamot

qml: change foreground based on background in IconToolButton

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dcd732b4cfbfa8bf8e489f12a9e7b4bd9bb6b922
---

 modules/gui/qt/widgets/qml/IconToolButton.qml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/widgets/qml/IconToolButton.qml b/modules/gui/qt/widgets/qml/IconToolButton.qml
index b90be77273..08cfc76ca3 100644
--- a/modules/gui/qt/widgets/qml/IconToolButton.qml
+++ b/modules/gui/qt/widgets/qml/IconToolButton.qml
@@ -29,7 +29,7 @@ ToolButton {
     padding: 0
 
     property string iconText: ""
-    property color color: VLCStyle.colors.buttonText
+    property color color: focusBackground.foregroundColor
     property color colorDisabled: VLCStyle.colors.textInactive
     property color colorOverlay: "transparent"
     property string textOverlay: ""
@@ -105,7 +105,9 @@ ToolButton {
 
     background: FocusBackground {
         id: focusBackground
-        active: control.activeFocus || control.hovered || control.highlighted
+
+        active: control.activeFocus || control.hovered
+        defaultForeground: control.highlighted ? VLCStyle.colors.accent : VLCStyle.colors.icon
         implicitHeight: control.size
         implicitWidth: control.size
     }



More information about the vlc-commits mailing list