-
-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathIndicator.qml
More file actions
61 lines (45 loc) · 1.5 KB
/
Copy pathIndicator.qml
File metadata and controls
61 lines (45 loc) · 1.5 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
59
60
61
import "../components" as Components
import QtQuick
Rectangle {
id: indicator
property int activeZone: 0
property bool hovering: false
property var zones: []
width: parent.width
height: parent.height
color: "transparent"
opacity: 1
Repeater {
id: indicators
model: zones
Item {
id: zone
x: ((modelData.x / 100) * (indicator.width))
y: ((modelData.y / 100) * (indicator.height))
width: ((modelData.width / 100) * (indicator.width))
height: ((modelData.height / 100) * (indicator.height))
Rectangle {
property int padding: 2
anchors.fill: parent
anchors.margins: padding
color: {
if (activeZone == index)
return modelData.color ? colorHelper.tintWithAlpha(colorHelper.buttonColor, modelData.color, 0.6) : colorHelper.accentColor;
else
return modelData.color ? colorHelper.tintWithAlpha(colorHelper.buttonColor, modelData.color, 0.2) : colorHelper.buttonColor;
}
border.color: colorHelper.getBorderColor(color)
border.width: 1
radius: 5
Behavior on color {
ColorAnimation {
duration: 150
}
}
}
}
}
Components.ColorHelper {
id: colorHelper
}
}