[vlc-commits] qml: fix color handling in MenuBar
Prince Gupta
git at videolan.org
Mon Mar 1 10:40:20 UTC 2021
vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Tue Feb 23 15:54:04 2021 +0530| [6ed7e30a81ced0426ee45f93430ac8f9809cc6b6] | committer: Pierre Lamot
qml: fix color handling in MenuBar
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6ed7e30a81ced0426ee45f93430ac8f9809cc6b6
---
modules/gui/qt/menus/qml/Menubar.qml | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/modules/gui/qt/menus/qml/Menubar.qml b/modules/gui/qt/menus/qml/Menubar.qml
index 97ffa4c486..d5b73e4aaa 100644
--- a/modules/gui/qt/menus/qml/Menubar.qml
+++ b/modules/gui/qt/menus/qml/Menubar.qml
@@ -31,8 +31,10 @@ Item {
implicitHeight: menubarLayout.implicitHeight
implicitWidth: menubarLayout.implicitWidth
+ property color bgColor: "transparent"
property color textColor: VLCStyle.colors.text
- property color bgColor: VLCStyle.colors.bgHover
+ property color highlightedBgColor: VLCStyle.colors.bgHover
+ property color highlightedTextColor: VLCStyle.colors.bgHoverText
Action{ id: mediaMenu; text: i18n.qtr("&Media") ; onTriggered: menubar.popupMediaMenu(source); }
Action{ id: playbackMenu; text: i18n.qtr("&Playback") ; onTriggered: menubar.popupPlaybackMenu(source);}
@@ -104,12 +106,12 @@ Item {
text: control.text
font: control.font
opacity: enabled ? 1.0 : 0.3
- color: root.textColor
+ color: (control.hovered || index === root._menuIndex) ? root.highlightedTextColor : root.textColor
}
background: Rectangle {
- color: (control.hovered || index === root._menuIndex) ? root.bgColor
- : "transparent"
+ color: (control.hovered || index === root._menuIndex) ? root.highlightedBgColor
+ : root.bgColor
}
}
}
More information about the vlc-commits
mailing list