MediaPlayer.qml: Allow to scale correctly on lower resolutions
[apps/mediaplayer.git] / app / MediaPlayer.qml
index 92e9f39..063fb55 100644 (file)
@@ -17,6 +17,8 @@
 import QtQuick 2.11
 import QtQuick.Layouts 1.11
 import QtQuick.Controls 2.4
+import QtQuick.Window 2.13
+
 import AGL.Demo.Controls 1.0
 
 ApplicationWindow {
@@ -64,7 +66,9 @@ ApplicationWindow {
                 player.title = track.title
                 player.album = track.album
                 player.artist = track.artist
-                player.duration = track.duration
+
+                if ('duration' in track)
+                     player.duration = track.duration
 
                 if ('index' in track) {
                      playlistview.currentIndex = track.index
@@ -90,9 +94,9 @@ ApplicationWindow {
     Item {
         id: container
         anchors.centerIn: parent
-        width: 1080
-        height: 1487
-        scale: screenInfo.scale_factor()
+        height: 1920 - 215 - 218
+       width: 1080
+        scale: (Screen.width/ 1080.0)
 
     ColumnLayout {
         anchors.fill: parent
@@ -253,7 +257,7 @@ ApplicationWindow {
         Item {
             Layout.fillWidth: true
             Layout.fillHeight: true
-            Layout.preferredHeight: 407
+            Layout.preferredHeight: container.height / 2
 
             ListView {
                 anchors.fill: parent