[vlc-devel] [PATCH 4/9] qml: show play cover on MusicTrackList cover images

jagannatharjun guptaprince8832 at gmail.com
Fri Jun 5 17:27:20 CEST 2020


From: Prince Gupta <guptaprince8832 at gmail.com>

---
 .../gui/qt/medialibrary/qml/MusicTrackListDisplay.qml  | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml b/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml
index 6b324a9c3b..a97aa2ad20 100644
--- a/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicTrackListDisplay.qml
@@ -54,6 +54,8 @@ Widgets.KeyNavigableTableView {
     property Component titleDelegate: RowLayout {
         property var rowModel: parent.rowModel
         property var model: parent.colModel
+        readonly property bool containsMouse: parent.containsMouse
+        readonly property bool currentlyFocused: parent.currentlyFocused
 
         anchors.fill: parent
         spacing: VLCStyle.margin_normal
@@ -64,6 +66,14 @@ Widgets.KeyNavigableTableView {
 
             Layout.preferredHeight: VLCStyle.heightAlbumCover_xsmall
             Layout.preferredWidth: VLCStyle.heightAlbumCover_xsmall
+
+            Widgets.PlayCover {
+                anchors.fill: parent
+                iconSize: VLCStyle.play_cover_small
+                visible: currentlyFocused || containsMouse
+
+                onIconClicked: medialib.addAndPlay( rowModel.id )
+            }
         }
 
         Widgets.ListLabel {
-- 
2.25.1



More information about the vlc-devel mailing list