[vlc-commits] qml: add header title bar to playlist listview

Fatih Uzunoglu git at videolan.org
Fri Jul 24 11:45:50 CEST 2020


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Thu Jul  2 16:47:33 2020 +0300| [ad8132a8d24346e80466a34b5406bfcc1ca043bb] | committer: Pierre Lamot

qml: add header title bar to playlist listview

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

 modules/gui/qt/playlist/qml/PlaylistListView.qml | 74 ++++++++++++++++++------
 1 file changed, 57 insertions(+), 17 deletions(-)

diff --git a/modules/gui/qt/playlist/qml/PlaylistListView.qml b/modules/gui/qt/playlist/qml/PlaylistListView.qml
index 56f76e5801..e70b9c15ba 100644
--- a/modules/gui/qt/playlist/qml/PlaylistListView.qml
+++ b/modules/gui/qt/playlist/qml/PlaylistListView.qml
@@ -193,25 +193,65 @@ Widgets.NavigableFocusScope {
             anchors.fill: parent
             anchors.bottomMargin: VLCStyle.margin_normal
 
-        Row {
-            width: root.width
-            leftPadding: VLCStyle.margin_normal
-            topPadding: VLCStyle.margin_normal
-            bottomPadding: VLCStyle.margin_large
-
-            ColumnLayout {
-                Widgets.SubtitleLabel {
-                    text: i18n.qtr("Playqueue")
-                }
+        ColumnLayout {
+            id: headerTextLayout
+            Layout.fillWidth: true
+            Layout.leftMargin: root.leftPadding + VLCStyle.margin_normal
+            Layout.topMargin: VLCStyle.margin_normal
 
-                Widgets.CaptionLabel {
-                    anchors.topMargin: VLCStyle.margin_small
-                    text: i18n.qtr("%1 elements, %2 min").arg(root.plmodel.count).arg(plmodel.duration.toMinutes())
-                }
+            Widgets.SubtitleLabel {
+                text: i18n.qtr("Playqueue")
+            }
+
+            Widgets.CaptionLabel {
+                anchors.topMargin: VLCStyle.margin_small
+                text: i18n.qtr("%1 elements, %2 min").arg(root.plmodel.count).arg(plmodel.duration.toMinutes())
             }
         }
 
 
+        RowLayout {
+            id: content
+            anchors {
+                bottom: view.top
+            }
+
+            Layout.preferredHeight: VLCStyle.icon_normal
+            Layout.leftMargin: root.leftPadding + VLCStyle.margin_normal
+            Layout.rightMargin: root.rightPadding + view.scrollBarWidth
+
+            Widgets.IconLabel {
+                Layout.preferredWidth: VLCStyle.icon_normal
+                horizontalAlignment: Text.AlignHCenter
+                verticalAlignment: Text.AlignVCenter
+                text: VLCIcons.album_cover
+                color: VLCStyle.colors.caption
+            }
+
+            Widgets.CaptionLabel {
+                Layout.fillWidth: true
+                Layout.leftMargin: VLCStyle.margin_large
+                verticalAlignment: Text.AlignVCenter
+                text: i18n.qtr("Title")
+            }
+
+            Widgets.IconLabel {
+                Layout.rightMargin: VLCStyle.margin_xsmall
+                Layout.preferredWidth: durationMetric.width
+
+                text: VLCIcons.time
+                color: VLCStyle.colors.caption
+                horizontalAlignment: Text.AlignHCenter
+                verticalAlignment: Text.AlignVCenter
+
+                TextMetrics {
+                    id: durationMetric
+                    font.pixelSize: VLCStyle.fontSize_normal
+                    text: "-00:00"
+                }
+            }
+        }
+
         Widgets.KeyNavigableListView {
             id: view
 
@@ -244,6 +284,7 @@ Widgets.NavigableFocusScope {
             }
 
             delegate: Column {
+
                 PLItem {
                     /*
                      * implicit variables:
@@ -341,7 +382,7 @@ Widgets.NavigableFocusScope {
                         /* move up */
                         target--
                     }
-    
+
                     view.currentIndex = selectedIndexes[0]
                     /* the target is the position _after_ the move is applied */
                     root.plmodel.moveItemsPost(selectedIndexes, target)
@@ -496,8 +537,7 @@ Widgets.NavigableFocusScope {
             navigationParent: root
             navigationUpItem: view
         }
-
-        }
+    }
     }
 
     Keys.priority: Keys.AfterItem



More information about the vlc-commits mailing list