-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComponentsActivity.qml
104 lines (89 loc) · 2.92 KB
/
ComponentsActivity.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
Item {
Component {
id: componentsDelegate
Item {
height: componentsView.cellHeight
width: componentsView.cellWidth
Rectangle {
id: componentElementBg
anchors.fill: parent
anchors {
topMargin: index < 3 ? 4 : 2
bottomMargin: index >= componentsView.model.count - 3 ? 4 : 2
leftMargin: index % 3 == 0 ? 4 : 2
rightMargin: (index + 1) % 3 == 0 ? 4 : 2
}
color: Qt.hsla((1 / 30) * (index % 30), 0.8, parameters.luminance)
Rectangle {
id: componentFooter
anchors {
bottom: parent.bottom
left: parent.left
right: parent.right
}
height: 48
color: "black"
opacity: 0.45
}
Text {
x: test.x
y: test.y + 1
color: "black"
opacity: 0.8
text: letter ? letter : "/"
font.pixelSize: 48
font.bold: true
}
Text {
id: test
anchors.centerIn: parent
color: "white"
text: letter ? letter : "/"
font.pixelSize: 48
font.bold: true
}
Text {
text: name
anchors.centerIn: componentFooter
color: "white"
}
}
MouseArea {
anchors.fill: parent
onClicked: {
stack.stackItems[1].pageTitle = name;
stack.stackItems[1].column = column;
stack.stackItems[1].name = name;
stack.stackItems[1].unite = ajr[column]["unite"];
stack.stackItems[1].rdi = ajr[column]["ajr"];
stack.stackItems[1].refresh();
stack.push(stack.stackItems[1]);
}
}
}
}
GridView {
id: componentsView
anchors {
top: parent.top
bottom: parent.bottom
horizontalCenter: root.horizontalCenter
}
width: root.width
model: ComponentsModel {}
delegate: componentsDelegate
snapMode: ListView.SnapToItem
clip: true
contentWidth: width
contentHeight: cellHeight * model.count
cellWidth: width / 3
cellHeight: cellWidth * 1.2
onMovementStarted: {
searchField.focus = false;
}
ScrollBar.vertical: ScrollBar {}
}
}