[vlc-commits] qml: use positioners instead of layout in GridItem

Prince Gupta git at videolan.org
Tue Aug 18 17:14:44 CEST 2020


vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Wed Aug  5 16:27:07 2020 +0530| [a9b877456cd3619f728b0fc1ba8c742175c7e16d] | committer: Pierre Lamot

qml: use positioners instead of layout in GridItem

positioners don't allocate space for hidden items

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

 modules/gui/qt/widgets/qml/GridItem.qml | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/modules/gui/qt/widgets/qml/GridItem.qml b/modules/gui/qt/widgets/qml/GridItem.qml
index 17ada4ad7c..c5a7af0aa2 100644
--- a/modules/gui/qt/widgets/qml/GridItem.qml
+++ b/modules/gui/qt/widgets/qml/GridItem.qml
@@ -186,11 +186,10 @@ Item {
                 color: Qt.rgba(0, 0, 0, .18)
             }
 
-            ColumnLayout {
+            Column {
                 id: layout
 
                 anchors.centerIn: parent
-                spacing: 0
 
                 Widgets.MediaCover {
                     id: picture
@@ -200,10 +199,6 @@ Item {
                     playCoverVisible: root._highlighted
                     onPlayIconClicked: root.playClicked()
 
-                    Layout.preferredWidth: pictureWidth
-                    Layout.preferredHeight: pictureHeight
-                    Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
-
                     /* new indicator (triangle at top-left of cover)*/
                     Rectangle {
                         id: newIndicator
@@ -226,11 +221,9 @@ Item {
 
                     label: titleLabel
                     scroll: _highlighted
-
-                    Layout.preferredHeight: titleLabel.contentHeight
-                    Layout.topMargin: root.titleMargin
-                    Layout.fillWidth: true
-                    Layout.maximumWidth: pictureWidth
+                    height: titleLabel.height
+                    width: titleLabel.width
+                    visible: root.title !== ""
 
                     Widgets.MenuLabel {
                         id: titleLabel
@@ -238,6 +231,7 @@ Item {
                         elide: Text.ElideNone
                         width: pictureWidth
                         horizontalAlignment: root.textHorizontalAlignment
+                        topPadding: root.titleMargin
                     }
                 }
 
@@ -246,14 +240,7 @@ Item {
 
                     visible: text !== ""
                     text: root.subtitle
-
-                    Layout.preferredHeight: implicitHeight
-                    Layout.maximumWidth: pictureWidth
-                    Layout.fillWidth: true
-                }
-
-                Item {
-                    Layout.fillHeight: true
+                    width: pictureWidth
                 }
             }
         }



More information about the vlc-commits mailing list