forked from 0x20/tab-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
StatsView.qml
125 lines (110 loc) · 3.5 KB
/
StatsView.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import QtQuick 2.9
import QtQuick.Layouts 1.3
import "controls"
import "Colors.js" as Colors
Rectangle {
id: display
signal canceled()
color: "black"
RowLayout {
spacing: 10
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: buttons.top
ListView {
model: members
clip: true
Layout.fillHeight: true
Layout.fillWidth: true
headerPositioning: ListView.OverlayHeader
header: Row {
width: parent.width
spacing: 5
z: 10
Rectangle {
color: Colors.primary[4]
width: parent.width - itemHdr.width - balanceHdr.width - 10
height: fontSize + 10
Text {
anchors.margins: 5
anchors.fill: parent
text: "Name"
color: "white"
font.pixelSize: fontSize
}
}
Rectangle {
id: itemHdr
color: Colors.primary[4]
width: 100
height: fontSize + 10
Text {
anchors.margins: 5
anchors.fill: parent
text: "Items"
color: "white"
font.pixelSize: fontSize
horizontalAlignment: Text.AlignRight
}
}
Rectangle {
id: balanceHdr
color: Colors.primary[4]
width: 150
height: fontSize + 10
Text {
anchors.margins: 5
anchors.fill: parent
text: "Balance"
color: "white"
font.pixelSize: fontSize
horizontalAlignment: Text.AlignRight
}
}
}
delegate: Rectangle {
color: (index % 2 > 0) ? Colors.primary[1] : "black"
width: parent.width
height: fontSize * 1.2
Row {
width: parent.width
Text {
width: parent.width - itemQty.width - balanceLbl.width
text: name
color: "white"
font.pixelSize: fontSize
}
Text {
id: itemQty
width: 100
text: items_bought
color: "white"
font.pixelSize: fontSize
horizontalAlignment: Text.AlignRight
}
Text {
width: 150
id: balanceLbl
text: formatCurrency(balance)
color: "white"
font.pixelSize: fontSize
horizontalAlignment: Text.AlignRight
}
}
}
}
}
Row {
id: buttons
TqButton {
text: "Back"
bgColor: "secondary1"
onClicked: display.canceled()
}
anchors.margins: 10
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
}
}