[vlc-devel] [PATCH 11/16] qml: use colDelegate on MusicTrackListDisplay

Abel Tesfaye abeltesfaye45 at gmail.com
Fri Aug 9 17:23:48 CEST 2019


From: Abel Tesfaye <Abeltesfaye45 at gmail.com>

---
 .../qml/mediacenter/MusicTrackListDisplay.qml | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/modules/gui/qt/qml/mediacenter/MusicTrackListDisplay.qml b/modules/gui/qt/qml/mediacenter/MusicTrackListDisplay.qml
index 9314cd0ecc..a9ae6a7505 100644
--- a/modules/gui/qt/qml/mediacenter/MusicTrackListDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MusicTrackListDisplay.qml
@@ -59,6 +59,30 @@ Utils.KeyNavigableTableView {
 
     property alias parentId: rootmodel.parentId
 
+    colDelegate: Item {
+        anchors.fill: parent
+
+        property var rowModel: parent.rowModel
+        property var model: parent.colModel
+
+        Text {
+            anchors.fill:parent
+
+            text: !rowModel ? "" : (rowModel[model.criteria] || "")
+            elide: Text.ElideRight
+            font.pixelSize: VLCStyle.fontSize_normal
+            color: (model.isPrimary)? VLCStyle.colors.text : VLCStyle.colors.textInactive
+
+            anchors {
+                fill: parent
+                leftMargin: VLCStyle.margin_xsmall
+                rightMargin: VLCStyle.margin_xsmall
+            }
+            verticalAlignment: Text.AlignVCenter
+            horizontalAlignment: Text.AlignLeft
+        }
+    }
+
     onActionForSelection: {
         var list = []
         for (var i = 0; i < selection.count; i++ ) {
-- 
2.21.0



More information about the vlc-devel mailing list