From 326571ecb4fea59702a9b28b22dba45b25eb683b Mon Sep 17 00:00:00 2001 From: Bramastyo Harimukti Santoso Date: Mon, 10 Feb 2020 16:32:46 +0100 Subject: [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 --- apps/com.luxoft.vehicle/panels/RoofPanel.qml | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'apps') 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) } } -- cgit v1.2.3