summaryrefslogtreecommitdiff
path: root/DefaultHomeStackView.ui.qml
blob: 7c83a4d46b92a410eeff200808b9f035fe38cae8 (plain)
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
import QtQuick 2.15
import QtQuick.Controls 2.15

StackView {
	property alias grid: grid

	initialItem: Item {

		GridView {
			id: counter
			model: ListModel {
				ListElement {
					count: "10K"
					bgColor: "#26f7c32e"
				}
				ListElement {
					count: "200+"
					bgColor: "#1a1d3b53"
				}
				ListElement {
					count: "60K+"
					bgColor: "#1a6f42c1"
				}
				ListElement {
					count: "6K+"
					bgColor: "#1a17a2b8"
				}
			}

			delegate: Item {
				width: counter.cellWidth
				height: 125.6
				Rectangle {
					color: bgColor
					radius: 8
					anchors {
						top: parent.top
						topMargin: 25.6
						left: parent.left
						leftMargin: 12.8
						right: parent.right
						rightMargin: 12.8
						bottom: parent.bottom
					}

					FontLoader {
						id: heebo
						name: "Heebo"
						source: "Heebo/Heebo-Bold.ttf"
					}

					Label {
						id: label
						text: count
						font {
							family: heebo.name
							pixelSize: 21
						}
					}
				}
			}

			cellWidth: width < 576 ? width : width < 768 ? width / 2
			: width < 992 ? width / 3 : width / 4
			cellHeight: cellWidth * 1.3
			anchors {
				top: parent.top
				left: parent.left
				right: parent.right
			}
			height: 100
		}

		GridView {
			id: grid
			cellWidth: width < 576 ? width : width < 768 ? width / 2
			: width < 992 ? width / 3 : width / 4
			cellHeight: cellWidth * 1.3
			anchors {
				left: parent.left
				right: parent.right
				bottom: parent.bottom
			}
			height: parent.height - 100
		}
	}
}