app/HVAC.qml: Use the Window width and height instead of using Screen
[apps/hvac.git] / app / HVAC.qml
index 2610164..744ec8d 100644 (file)
@@ -17,6 +17,7 @@
 import QtQuick 2.6
 import QtQuick.Layouts 1.1
 import QtQuick.Controls 2.0
+import QtQuick.Window 2.11
 import AGL.Demo.Controls 1.0
 import Translator 1.0
 import 'api' as API
@@ -24,6 +25,9 @@ import 'api' as API
 ApplicationWindow {
     id: root
 
+    width: container.width * container.scale
+    height: container.height * container.scale
+
        Translator {
                id: translator
                language: binding.language
@@ -36,6 +40,15 @@ ApplicationWindow {
                onLanguageChanged: translator.language = language
        }
 
+    Item {
+        id: container
+        anchors.centerIn: parent
+        //width: Window.width
+        width: 1080
+        height: Window.height
+        //scale: Window.scale
+        scale: 1
+
        ColumnLayout {
                anchors.fill: parent
                anchors.topMargin: width / 10
@@ -47,7 +60,7 @@ ApplicationWindow {
                                source: './images/HMI_HVAC_Fan_Icon.svg'
                        }
                        Item {
-                               width: root.width * 0.8
+                               width: container.width * 0.8
                                Slider {
                                        id: fanSpeedSlider
                                        anchors.left: parent.left
@@ -158,3 +171,4 @@ ApplicationWindow {
                }
        }
 }
+}