-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFpsLatencyIndicator.qml
More file actions
86 lines (72 loc) · 2.84 KB
/
Copy pathFpsLatencyIndicator.qml
File metadata and controls
86 lines (72 loc) · 2.84 KB
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
import QtQuick
import QtQuick.Layouts
import qmlcomponents
ColumnLayout {
property var controller: null
visible: controller != null ? controller.visible : false
spacing: 0
RowLayout {
spacing: TibiaStyle.marginRelated
Image {
id: latencyIcon
states: [
State {
name: "LOW_LATENCY"
when: controller != null && controller.currentLatencyState == "low"
PropertyChanges { target: latencyIcon; source: "/images/latency/latency-low.png" }
PropertyChanges { target: latencyTooltip; latencyTextIdentifier: "latency_low"}
},
State {
name: "MEDIUM_LATENCY"
when: controller != null && controller.currentLatencyState == "medium"
PropertyChanges { target: latencyIcon; source: "/images/latency/latency-medium.png" }
PropertyChanges { target: latencyTooltip; latencyTextIdentifier: "latency_medium"}
},
State {
name: "HIGH_LATENCY"
when: controller != null && controller.currentLatencyState == "high"
PropertyChanges { target: latencyIcon; source: "/images/latency/latency-high.png" }
PropertyChanges { target: latencyTooltip; latencyTextIdentifier: "latency_high"}
},
State {
name: "MEASURING_LATENCY"
when: controller != null && controller.currentLatencyState == "measuring"
PropertyChanges { target: latencyIcon; source: "/images/latency/latency-high.png" }
PropertyChanges { target: latencyTooltip; latencyTextIdentifier: "latency_measuring"}
}
] //states
Image {
source: controller != null && controller.optimizedConnectionStability ? "/images/latency/optimized-connection-stability.png" : ""
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
} //Image
state: "LOW_LATENCY"
Tooltip {
id: latencyTooltip
anchors.fill: parent
property string latencyText: "-"
property string latencyTextIdentifier: "latency_high"
text: qsTrId("latency_text").arg(qsTrId(latencyTextIdentifier)).arg(controller != null ? controller.currentLatency : "0")
} //Tooltip
} //Image
TibiaCachedOutlineText {
id: latencyDisplay
text: latencyTooltip.text
styleType: "Default"
cacheMode: CachedOutlineText.NoCaching
} //TibiaCachedOutlineText
} //RowLayout
RowLayout {
spacing: TibiaStyle.marginRelated
Item {
Layout.preferredWidth: latencyIcon.width
Layout.preferredHeight: latencyIcon.height
} //Item
TibiaCachedOutlineText {
id: fpsDisplay
text: qsTrId("fps_text").arg(controller != null ? controller.currentFrameRate : 0)
styleType: "Default"
cacheMode: CachedOutlineText.NoCaching
} //TibiaCachedOutlineText
} //RowLayout
} //ColumnLayout