diff options
author | Bramastyo Harimukti Santoso <bram.santoso@qt.io> | 2020-02-10 16:32:46 +0100 |
---|---|---|
committer | Egor Nemtsev <enemtsev@luxoft.com> | 2020-02-17 08:50:35 +0000 |
commit | 326571ecb4fea59702a9b28b22dba45b25eb683b (patch) | |
tree | 42254614129504ef6a4bcbe9e861023276b12039 /apps | |
parent | 5cbdfa1b44ed60bb43732f947f0b716a9f59b34b (diff) |
[vehicle] update the roof panel
- to improve the user experience, we can only use one button to
open / close the sunroof
Change-Id: I518385b9dcd087b63bc8651b3a0376b7be3dc0de
Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/com.luxoft.vehicle/panels/RoofPanel.qml | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/apps/com.luxoft.vehicle/panels/RoofPanel.qml b/apps/com.luxoft.vehicle/panels/RoofPanel.qml index 6adcbac2..20c077d3 100644 --- a/apps/com.luxoft.vehicle/panels/RoofPanel.qml +++ b/apps/com.luxoft.vehicle/panels/RoofPanel.qml @@ -90,26 +90,15 @@ Item { } VehicleButton { - id: roofOpenButton - objectName: "roofOpenButton" + id: roofButton + objectName: "roofButton" - anchors.top: om.verticalCenter - anchors.topMargin: -height - anchors.right: parent.right - state: "REGULAR" - text: qsTr("Close") - onClicked: root.newRoofOpenProgressRequested(0.0) - } - - VehicleButton { - id: roofCloseButton - objectName: "roofCloseButton" - - anchors.top: om.verticalCenter - anchors.topMargin: -height - anchors.left: parent.left + anchors.bottom: om.bottom + anchors.bottomMargin: Sizes.dp(135) + anchors.horizontalCenter: parent.horizontalCenter state: "REGULAR" - text: qsTr("Open") - onClicked: root.newRoofOpenProgressRequested(1.0) + text: root.roofOpenProgress > 0.0 ? qsTr("Close") : qsTr("Open") + onClicked: root.roofOpenProgress < 1.0 ? root.newRoofOpenProgressRequested(1.0) : + root.newRoofOpenProgressRequested(0.0) } } |