-
Notifications
You must be signed in to change notification settings - Fork 2
/
TrackerVisualizer.qml
74 lines (69 loc) · 2.1 KB
/
TrackerVisualizer.qml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
import QtQuick 2.9
import QtQuick.Controls.Material 2.2
import QtQuick.Controls 2.2
Item {
id: trackerVisualizer
property var model
property var index
property var channelCount
anchors.fill: parent
signal toggleChannel(int index, bool isActive)
ListView {
id: trackerListView
interactive: false
clip: true
anchors.fill: parent
model: parent.model
currentIndex: parent.index
orientation: ListView.Vertical
preferredHighlightBegin: 50
preferredHighlightEnd: 50
highlightRangeMode: ListView.ApplyRange
highlightMoveDuration: 0
headerPositioning: ListView.OverlayHeader
header: Rectangle {
height: 50
z: 2
color: Material.background
width: parent.width
ListView {
interactive: false
anchors.fill: parent
model: channelCount
orientation: ListView.Horizontal
delegate: Button {
flat: true
width: 40
height: 50
checkable: true
checked: true
text: index
onPressed: trackerVisualizer.toggleChannel(index, checked)
}
}
}
// The rows
delegate: Rectangle {
id: delegateRect
height: 40
color: Material.background
width: parent.width
ListView {
interactive: false
anchors.fill: parent
model: modelData;
orientation: ListView.Horizontal
delegate: Rectangle {
color: Material.background
width: 40
height: 40
Text {
text: modelData;
anchors.fill: parent
color: delegateRect.ListView.isCurrentItem ? Material.foreground : Material.accent
}
}
}
}
}
}