-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimerDial.qml
More file actions
58 lines (56 loc) · 1.76 KB
/
Copy pathTimerDial.qml
File metadata and controls
58 lines (56 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import QtQuick 2.0
import QtQuick.Controls 2.2
Item {
property alias dialHeight: dial.height
property alias text: textObj.text
property alias value: dial.value
//height: 40
Dial{
//anchors.fill: parent
id: dial
from: 0
to: 1
stepSize: 0.1
snapMode: "SnapAlways"
height: parent.height
width: height
anchors.centerIn: parent
background: Rectangle {
x: dial.width / 2 - width / 2
y: dial.height / 2 - height / 2
width: Math.max(64, Math.min(dial.width, dial.height))
height: width
color: "#cefbd2"
radius: width / 2
border.color: dial.pressed ? "#17a81a" : "#21be2b"
opacity: dial.enabled ? 1 : 0.3
}
handle: Rectangle {
id: handleItem
x: dial.background.x + dial.background.width / 2 - width / 2
y: dial.background.y + dial.background.height / 2 - height / 2
width: dial.width/10
height: width
color: dial.pressed ? "#17a81a" : "#21be2b"
radius: width/2
antialiasing: true
opacity: dial.enabled ? 1 : 0.3
transform: [
Translate {
y: -Math.min(dial.background.width, dial.background.height) * 0.4 + handleItem.height / 2
},
Rotation {
angle: dial.angle
origin.x: handleItem.width / 2
origin.y: handleItem.height / 2
}
]
}
Text{
id: textObj
anchors.centerIn: dial
text: "PERM"
font.pointSize: dial.height? (dial.height/4) * 8/6 : 16
}
}
}