-
Notifications
You must be signed in to change notification settings - Fork 1
/
CircleStat.qml
84 lines (73 loc) · 1.93 KB
/
CircleStat.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
import QtQuick 2.8
import QtGraphicalEffects 1.0
import IO 1.0
import QtQuick.LocalStorage 2.0 as Sql
import "circlepic.js" as Scripts
Item {
id: card_avatar_backing
property string whichStat: ""
property string statNumber: ""
property int statRank: 0
opacity: if (statNumber == "0") {
0.2
} else {
1
}
clip: true
Rectangle {
anchors.centerIn: statcircle
width: statcircle.width * 0.75
height: statcircle.height * 0.75
color: Qt.rgba(1, 1, 1, 1)
radius: width / 2
border.width: 1
border.color: if (statRank < 50) {
"gray"
} else {
"goldenrod"
}
}
Rectangle {
id: statcircle
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
width: parent.height * 0.74
height: parent.height * 0.74
radius: width / 2
color: if (statRank < 50) {
"gray"
} else {
"goldenrod"
}
visible: false
}
OpacityMask {
anchors.fill: statcircle
source: statcircle
maskSource: mask1
}
Text {
id: stat
text: statNumber
anchors.centerIn: statcircle
font.pixelSize: parent.height * 0.4
width: statcircle.width
horizontalAlignment: Text.AlignHCenter
}
Text {
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
text: whichStat
width: parent.width
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
font.pixelSize: parent.width * 0.15
}
Image {
id: mask1
anchors.fill: parent
source: "./img/OpenCircle.png"
visible: false
fillMode: Image.PreserveAspectFit
}
}