[vlc-devel] [PATCH 01/14] qml: remove isVideo, isNew, infoLeft and 'NEW' label from GridItem

Prince Gupta guptaprince8832 at gmail.com
Thu Jul 2 14:23:10 CEST 2020


---
 .../gui/qt/medialibrary/qml/AudioGridItem.qml |  1 -
 .../gui/qt/medialibrary/qml/VideoGridItem.qml |  4 +--
 modules/gui/qt/widgets/qml/GridItem.qml       | 33 ++-----------------
 3 files changed, 4 insertions(+), 34 deletions(-)

diff --git a/modules/gui/qt/medialibrary/qml/AudioGridItem.qml b/modules/gui/qt/medialibrary/qml/AudioGridItem.qml
index 84eb37ff19..8db11c9788 100644
--- a/modules/gui/qt/medialibrary/qml/AudioGridItem.qml
+++ b/modules/gui/qt/medialibrary/qml/AudioGridItem.qml
@@ -27,7 +27,6 @@ Widgets.GridItem {
     image: model.cover || VLCStyle.noArtAlbum
     title: model.title || i18n.qtr("Unknown title")
     subtitle: model.main_artist || i18n.qtr("Unknown artist")
-    isVideo: false
     pictureWidth: VLCStyle.cover_normal
     pictureHeight: VLCStyle.cover_normal
 }
diff --git a/modules/gui/qt/medialibrary/qml/VideoGridItem.qml b/modules/gui/qt/medialibrary/qml/VideoGridItem.qml
index 368dd1b221..4e11c04be7 100644
--- a/modules/gui/qt/medialibrary/qml/VideoGridItem.qml
+++ b/modules/gui/qt/medialibrary/qml/VideoGridItem.qml
@@ -26,13 +26,11 @@ Widgets.GridItem {
     property var model: ({})
     image: model.thumbnail || VLCStyle.noArtCover
     title: model.title || i18n.qtr("Unknown title")
-    infoLeft: model.duration || ""
+    subtitle: model.duration || ""
     labels: [
         model.resolution_name || "",
         model.channel || ""
     ].filter(function(a) { return a !== "" } )
-    isVideo: true
-    isNew: model.playcount < 1
     progress: model.progress > 0 ? model.progress : 0
     pictureWidth: VLCStyle.video_normal_width
     pictureHeight: VLCStyle.video_normal_height
diff --git a/modules/gui/qt/widgets/qml/GridItem.qml b/modules/gui/qt/widgets/qml/GridItem.qml
index 680b36a07a..4269cf9df2 100644
--- a/modules/gui/qt/widgets/qml/GridItem.qml
+++ b/modules/gui/qt/widgets/qml/GridItem.qml
@@ -33,13 +33,10 @@ Item {
     property string subtitle: ""
     property bool selected: false
 
-    property string infoLeft: ""
-    property bool isVideo: false
-    property bool isNew: false
     property double progress: 0
     property var labels: []
-    property real pictureWidth: isVideo ? VLCStyle.video_normal_width : VLCStyle.cover_small
-    property real pictureHeight: isVideo ? VLCStyle.video_normal_height : VLCStyle.cover_small
+    property real pictureWidth: VLCStyle.colWidth(1)
+    property real pictureHeight: ( pictureWidth * 10 ) / 16
 
     //space use for zoom
     readonly property real outterMargin: VLCStyle.margin_xxsmall
@@ -171,7 +168,7 @@ Item {
 
                     VideoProgressBar {
                         value: root.progress
-                        visible: isVideo && root.progress > 0
+                        visible: root.progress > 0
                         anchors {
                             bottom: parent.bottom
                             left: parent.left
@@ -211,30 +208,6 @@ Item {
 
                 }
 
-                RowLayout {
-                    visible: isVideo
-
-                    Layout.preferredHeight: implicitHeight
-                    Layout.fillWidth: true
-                    Layout.maximumWidth: _picWidth
-
-                    Text {
-                        Layout.alignment: Qt.AlignLeft
-                        Layout.fillWidth: true
-                        font.pixelSize: VLCStyle.fontSize_small
-                        color: VLCStyle.colors.textInactive
-                        text: infoLeft
-                    }
-                    Text {
-                        visible: root.isNew
-                        Layout.alignment: Qt.AlignRight
-                        font.pixelSize: VLCStyle.fontSize_small
-                        color: root.activeFocus ? VLCStyle.colors.text : VLCStyle.colors.accent
-                        text: "NEW"
-                        font.bold: true
-                    }
-                }
-
                 Item {
                     Layout.fillHeight: true
                 }
-- 
2.25.1



More information about the vlc-devel mailing list