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/. */
11 width: childrenRect.width
12 height: childrenRect.height
14 property real value: 0
18 source: "images/fan_icon_off.png"
24 source: "images/fan_bar_off.png"
29 width: value * fanBar.width
30 fillMode: Image.PreserveAspectCrop
31 horizontalAlignment: Image.AlignLeft
32 source: "images/fan_bar_on.png"
37 anchors.verticalCenter: parent.bottom
38 anchors.verticalCenterOffset: -1
39 anchors.horizontalCenter: parent.right
40 source: "images/drag_knob.svg"
50 value = Math.min(Math.max(mouse.x / fanBar.width, 0), 1)
51 HVACModel.fanSpeed = value;