[vlc-devel] [PATCH 20/21] qml: reduce top margin and better scale center layout of maxplayer

Prince Gupta guptaprince8832 at gmail.com
Fri Oct 23 15:21:14 CEST 2020


---
 modules/gui/qt/player/qml/Player.qml | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt/player/qml/Player.qml b/modules/gui/qt/player/qml/Player.qml
index aad85d8c72..c592393a09 100644
--- a/modules/gui/qt/player/qml/Player.qml
+++ b/modules/gui/qt/player/qml/Player.qml
@@ -306,6 +306,7 @@ Widgets.NavigableFocusScope {
 
             Layout.fillWidth: true
             Layout.fillHeight: true
+            Layout.topMargin: VLCStyle.margin_xsmall
 
             ColumnLayout {
                 anchors.fill: parent
@@ -319,11 +320,12 @@ Widgets.NavigableFocusScope {
                 }
 
                 Item {
-                    Layout.fillWidth: true
                     Layout.fillHeight: true
+                    Layout.preferredHeight: Math.max(Math.min(parent.height, parent.width - VLCStyle.margin_small * 2), 0)
                     Layout.maximumHeight: rootPlayer.height / 2
                     Layout.minimumHeight: 1
-                    Layout.topMargin: albumLabel.Layout.preferredHeight + artistLabel.Layout.preferredHeight + audioControls.width
+                    Layout.preferredWidth: height * cover.sar
+                    Layout.alignment: Qt.AlignHCenter
 
                     Image {
                         id: cover
@@ -334,10 +336,7 @@ Widgets.NavigableFocusScope {
 
                         //source aspect ratio
                         readonly property real sar: cover.sourceSize.width / cover.sourceSize.height
-
-                        height: Math.min(parent.height, parent.width - VLCStyle.margin_small * 2)
-                        width: height  * sar
-                        anchors.centerIn: parent
+                        anchors.fill: parent
                     }
 
                     DropShadow {
-- 
2.25.1



More information about the vlc-devel mailing list