homescreenhandler: Include homescreen handler
[apps/hvac.git] / app / HVAC.qml
index 8aa88c1..c8dc7bb 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
 
@@ -40,9 +41,9 @@ ApplicationWindow {
     Item {
         id: container
         anchors.centerIn: parent
-        width: 1080
-        height: 1487
-        scale: screenInfo.scale_factor()
+        width: Window.width
+        height: Window.height
+        scale: Window.scale
 
        ColumnLayout {
                anchors.fill: parent
@@ -55,7 +56,7 @@ ApplicationWindow {
                                source: './images/HMI_HVAC_Fan_Icon.svg'
                        }
                        Item {
-                               width: container.width * 0.8
+                               width: 1080 * 0.8
                                Slider {
                                        id: fanSpeedSlider
                                        anchors.left: parent.left
@@ -147,6 +148,39 @@ ApplicationWindow {
                                        }
                                }
                        }
+
+                       ColumnLayout {
+                               Layout.fillWidth: true
+                               spacing: 20
+                               ToggleButton {
+                                       onImage: './images/HMI_HVAC_Active.svg'
+                                       offImage: './images/HMI_HVAC_Inactive.svg'
+                                       Label {
+                                               anchors.centerIn: parent
+                                               color: parent.checked ? '#00ADDC' : '#848286'
+                                               text: translator.translate(qsTr('Split Right'), translator.language)
+                                               font.pixelSize: parent.height / 4
+                                       }
+                                       onCheckedChanged: {
+                                               console.debug('Split on the right', checked)
+                                               homescreenHandler.setOrientation("hvac", 2)
+                                       }
+                               }
+                               ToggleButton {
+                                       onImage: './images/HMI_HVAC_Active.svg'
+                                       offImage: './images/HMI_HVAC_Inactive.svg'
+                                       Label {
+                                               anchors.centerIn: parent
+                                               color: parent.checked ? '#00ADDC' : '#848286'
+                                               text: translator.translate(qsTr('Split Top'), translator.language)
+                                               font.pixelSize: parent.height / 4
+                                       }
+                                       onCheckedChanged: {
+                                               console.debug('Split on top', checked)
+                                               homescreenHandler.setOrientation("hvac", 3)
+                                       }
+                               }
+                       }
                }
 
                RowLayout {