From 7e1b270c1e7ac8ad2493cfc36f85cbe06256abc5 Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Fri, 2 Nov 2018 13:29:34 +0900 Subject: change to horizontal mode --- app/HVAC.qml | 256 ++++++++++++++++++++++++++++++----------------------------- app/main.cpp | 2 +- 2 files changed, 131 insertions(+), 127 deletions(-) diff --git a/app/HVAC.qml b/app/HVAC.qml index 8867168..317ef70 100644 --- a/app/HVAC.qml +++ b/app/HVAC.qml @@ -27,10 +27,10 @@ ApplicationWindow { width: container.width * container.scale height: container.height * container.scale - Translator { - id: translator - language: binding.language - } + Translator { + id: translator + language: binding.language + } API.Binding { id: binding @@ -41,131 +41,135 @@ ApplicationWindow { Item { id: container - anchors.centerIn: parent - width: 1080 - height: 1487 +// anchors.centerIn: parent + x: 555 + y: -465 + width: 720 + height: 1920 + rotation: -90 scale: screenInfo.scale_factor() - ColumnLayout { - anchors.fill: parent - anchors.topMargin: width / 10 - anchors.bottomMargin: width / 10 - RowLayout { - Layout.fillHeight: true - Layout.alignment: Qt.AlignHCenter - Image { - source: './images/HMI_HVAC_Fan_Icon.svg' - } - Item { - width: container.width * 0.8 - Slider { - id: fanSpeedSlider - anchors.left: parent.left - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - from: 0.0 - to: 255.0 - stepSize: 1.0 - onValueChanged: { - binding.fanSpeed = value - } - } - Label { - anchors.left: fanSpeedSlider.left - anchors.top: fanSpeedSlider.bottom - font.pixelSize: 32 - text: translator.translate(qsTr('FAN SPEED'), translator.language) - } - } - } - RowLayout { - Layout.fillHeight: true - Layout.fillWidth: true - Layout.alignment: Layout.Center - spacing: 20 - ColumnLayout { - Layout.fillWidth: true - spacing: 20 - SeatHeatButton { - id: leftSeat - side: 'Left' - } - HeatDegree { - onCurrentItemChanged: { - console.log("Left Temp changed",degree) - binding.leftTemperature = degree - } - } - } - 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('A/C'), translator.language) - font.pixelSize: parent.height / 3 - } - onCheckedChanged: { - console.debug('A/C', checked) - } - } - 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('AUTO'), translator.language) - font.pixelSize: parent.height / 3 - } - onCheckedChanged: { - console.debug('AUTO', checked) - } - } - ToggleButton { - onImage: './images/HMI_HVAC_Circulation_Active.svg' - offImage: './images/HMI_HVAC_Circulation_Inactive.svg' - onCheckedChanged: { - console.debug('Circulation', checked) - } - } - } + ColumnLayout { + anchors.fill: parent + anchors.topMargin: width / 10 + anchors.bottomMargin: width / 10 - ColumnLayout { - Layout.fillWidth: true - spacing: 20 - SeatHeatButton { - id: rightSeat - side: 'Right' - } - HeatDegree { - onCurrentItemChanged: { - console.log("Right Temp changed",degree) - binding.rightTemperature = degree - } - } - } - } + RowLayout { + Layout.fillHeight: true + Layout.alignment: Qt.AlignHCenter + Image { + source: './images/HMI_HVAC_Fan_Icon.svg' + } + Item { + width: container.width * 0.8 + Slider { + id: fanSpeedSlider + anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + from: 0.0 + to: 255.0 + stepSize: 1.0 + onValueChanged: { + binding.fanSpeed = value + } + } + Label { + anchors.left: fanSpeedSlider.left + anchors.top: fanSpeedSlider.bottom + font.pixelSize: 32 + text: translator.translate(qsTr('FAN SPEED'), translator.language) + } + } + } + RowLayout { + Layout.fillHeight: true + Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + rotation: 90 + spacing: 20 + ColumnLayout { + Layout.fillWidth: true + spacing: 20 + SeatHeatButton { + id: leftSeat + side: 'Left' + } + HeatDegree { + onCurrentItemChanged: { + console.log("Left Temp changed",degree) + binding.leftTemperature = degree + } + } + } + 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('A/C'), translator.language) + font.pixelSize: parent.height / 3 + } + onCheckedChanged: { + console.debug('A/C', checked) + } + } + 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('AUTO'), translator.language) + font.pixelSize: parent.height / 3 + } + onCheckedChanged: { + console.debug('AUTO', checked) + } + } + ToggleButton { + onImage: './images/HMI_HVAC_Circulation_Active.svg' + offImage: './images/HMI_HVAC_Circulation_Inactive.svg' + onCheckedChanged: { + console.debug('Circulation', checked) + } + } + } - RowLayout { - Layout.fillHeight: true - Layout.alignment: Qt.AlignHCenter - spacing: root.width / 20 - Repeater { - model: ['AirDown', 'AirUp', 'AirRight', 'Rear', 'Front'] - ToggleButton { - onImage: './images/HMI_HVAC_%1_Active.svg'.arg(model.modelData) - offImage: './images/HMI_HVAC_%1_Inactive.svg'.arg(model.modelData) - onCheckedChanged: { - console.debug(model.modelData, checked) - } - } - } - } - } + ColumnLayout { + Layout.fillWidth: true + spacing: 20 + SeatHeatButton { + id: rightSeat + side: 'Right' + } + HeatDegree { + onCurrentItemChanged: { + console.log("Right Temp changed",degree) + binding.rightTemperature = degree + } + } + } + } + RowLayout { + Layout.fillHeight: true + Layout.alignment: Qt.AlignHCenter + Repeater { + model: ['AirDown', 'AirUp', 'AirRight', 'Rear', 'Front'] + ToggleButton { + onImage: './images/HMI_HVAC_%1_Active.svg'.arg(model.modelData) + offImage: './images/HMI_HVAC_%1_Inactive.svg'.arg(model.modelData) + rotation: 90 + onCheckedChanged: { + console.debug(model.modelData, checked) + } + } + } + } + } } } diff --git a/app/main.cpp b/app/main.cpp index 55a7688..c999488 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) #ifdef HAVE_QLIBWINDOWMANAGER QObject::connect(window, SIGNAL(frameSwapped()), qwm, SLOT(slotActivateSurface())); #else - window->resize(1080, 1920 - 218 - 215); + window->resize(1920, 720); window->setVisible(true); #endif -- cgit 1.2.3-korg