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/. */
15 property string side: "left"
16 property string propertyName: side + "Temperature"
17 property real value: HVACModel[propertyName]
22 snapMode: ListView.SnapToItem
23 model: TemperatureModel
24 header: Item { height: 120 }
25 footer: Item { height: 120 }
26 currentIndex: Math.min(value * count, count - 1)
27 flickDeceleration: 5000
29 if (dragging || flicking) {
30 var item = Math.round((contentY + 120) / 110)
31 item = Math.max(Math.min(item, count - 1), 0)
32 if (item != currentIndex) {
33 var temperature = item / (count - 1)
34 HVACModel[propertyName] = temperature
38 highlightMoveDuration: 100
42 x: side === "right" ? 40 : 10
44 verticalAlignment: Text.AlignVCenter
52 mirror: side === "left"
53 source: "./images/right_number_cover.svg"