2 * Copyright (C) 2016 The Qt Company Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 import QtQuick.Controls 2.0
26 opacity: enabled ? 1 : 0.5
28 property int degree: currentIndex > -1 ? model.get(currentIndex).value : -1
30 Component.onCompleted: {
31 append({value: 15, modelData: 'LO'})
32 for (var d = 16; d < 30; d++) {
33 append({value: d, modelData: d.toFixed(0) + '\u00b0'})
35 append({value: 30, modelData: 'HI'})
39 width: ListView.view.width
41 horizontalAlignment: Label.AlignHCenter
42 verticalAlignment: Label.AlignVCenter
44 font.pixelSize: height * 0.8
45 color: (ListView.view.enabled && ListView.isCurrentItem) ? '#66FF99' : 'white'
48 preferredHighlightBegin: 0.5
49 preferredHighlightEnd: 0.5
50 highlightRangeMode: ListView.StrictlyEnforceRange
51 highlight: Rectangle {