-
Notifications
You must be signed in to change notification settings - Fork 8
/
MultiListAnim.qml
68 lines (64 loc) · 2.14 KB
/
MultiListAnim.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
import Qt 4.7
import "colibri"
Rectangle {
width: 300
height: 500
CLSlider {
id: slider
width: parent.width
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
z: 2
}
ListView {
z: 1
anchors.top: slider.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
id: pythonList
model: pythonListModel
delegate: Component {
Rectangle {
width: pythonList.width
height: 20 + slider.value
gradient: Gradient {
GradientStop { position: 0; color: model.zenItem.checked?"#00B8F5":(index%2?"#eee":"#ddd") }
GradientStop { position: .93; color: model.zenItem.checked?"#0080A0":"#eee" }
GradientStop { position: 1; color: "#666" }
}
Text {
elide: Text.ElideRight
text: model.zenItem.name
color: (model.zenItem.checked?"white":"black")
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
right: (model.zenItem.checked?checkbox.left:parent.right)
leftMargin: 5
}
}
Text {
id: checkbox
z: 5
text: "✔"
font.pixelSize: parent.height
font.bold: true
visible: model.zenItem.checked
transformOrigin: Item.Right
color: "white"
anchors {
verticalCenter: parent.verticalCenter
right: parent.right
rightMargin: 5
}
}
MouseArea {
anchors.fill: parent
onClicked: { controller.toggled(pythonListModel, model.zenItem, checkbox, parent) }
}
}
}
}
}