[vlc-commits] qml: set proper colors for playlist item

Fatih Uzunoglu git at videolan.org
Thu Oct 15 10:32:51 CEST 2020


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Fri Oct  9 19:56:40 2020 +0300| [b0f0e9a9f20a08acfef30a9c55617060cc4cf88b] | committer: Pierre Lamot

qml: set proper colors for playlist item

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

 modules/gui/qt/playlist/qml/PLItem.qml           |  7 -------
 modules/gui/qt/playlist/qml/PlaylistListView.qml |  2 +-
 modules/gui/qt/style/VLCColors.qml               | 13 +++++++++++++
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/modules/gui/qt/playlist/qml/PLItem.qml b/modules/gui/qt/playlist/qml/PLItem.qml
index a3e72fcfb7..831174991d 100644
--- a/modules/gui/qt/playlist/qml/PLItem.qml
+++ b/modules/gui/qt/playlist/qml/PLItem.qml
@@ -159,13 +159,6 @@ Rectangle {
             }
         }
 
-        Rectangle {
-            id: selectedBackground
-            color: _colors.bg
-            anchors.fill: parent
-            visible: model.isCurrent && !plitem.hovered && !model.selected
-        }
-
         RowLayout {
             id: content
             anchors {
diff --git a/modules/gui/qt/playlist/qml/PlaylistListView.qml b/modules/gui/qt/playlist/qml/PlaylistListView.qml
index b833e42168..ca13da18d5 100644
--- a/modules/gui/qt/playlist/qml/PlaylistListView.qml
+++ b/modules/gui/qt/playlist/qml/PlaylistListView.qml
@@ -453,7 +453,7 @@ Widgets.NavigableFocusScope {
                                 contextMenu.popup(index, globalMousePos)
                         }
                         onItemDoubleClicked: mainPlaylistController.goTo(index, true)
-                        color: _colors.getBgColor(model.selected, plitem.hovered, plitem.activeFocus)
+                        color: _colors.getPLItemColor(model.selected, plitem.hovered, plitem.activeFocus)
                         _colors: root._colors
 
                         onDragStarting: {
diff --git a/modules/gui/qt/style/VLCColors.qml b/modules/gui/qt/style/VLCColors.qml
index 19094ad519..a3d36f1e52 100644
--- a/modules/gui/qt/style/VLCColors.qml
+++ b/modules/gui/qt/style/VLCColors.qml
@@ -86,7 +86,20 @@ Item {
     
     property color roundPlayCoverBorder: "#979797"
 
+    // playlist
     property color playlistSeparator: colors_id.white
+    property color plItemHover_Focus: isThemeDark ? "#272727" : "#DDDDDD"
+    property color plItemSelect:      isThemeDark ? "#1E1E1E" : "#EDEDED"
+
+    function getPLItemColor(selected, hovered, focus)
+    {
+        if (hovered || focus)
+            return plItemHover_Focus
+        else if ( selected )
+            return plItemSelect
+        else
+            return "transparent"
+    }
 
     // basic color definitions for color blending:
     property color black: "black"



More information about the vlc-commits mailing list