1 /* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved.
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
16 property real value: HVACModel[propertyName]
17 property string propertyName: side + "Temperature"
18 property string side: "left"
20 function setProperty(v) {
21 HVACModel[propertyName] = Math.min(Math.max(v, 0), 1)
31 height: value * parent.height
32 color: Style.orangeViv
33 anchors.bottom: parent.bottom
37 x: side === "left" ? parent.width + 30 : -30
39 height: value * parent.height
40 anchors.bottom: parent.bottom
46 anchors.verticalCenter: parent.top
47 anchors.horizontalCenter: parent.horizontalCenter
48 source: "images/drag_knob.svg"
53 x: side === "left" ? 0 : -45
54 width: parent.width + 45
57 onPressed: setProperty(1 - mouse.y / height)
58 onPositionChanged: setProperty(1 - mouse.y / height)