-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathImbuementInfoLayout.qml
More file actions
81 lines (62 loc) · 2.08 KB
/
Copy pathImbuementInfoLayout.qml
File metadata and controls
81 lines (62 loc) · 2.08 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
import QtQuick
import qmlcomponents
Item {
id: root
property int iconID: 0
property string name: ""
property alias remainingTime: remainingTimeText.text
property int visualization: TibiaEnums.AlmostNew
readonly property bool isUsed: iconID > 0
implicitHeight: TibiaStyle.containerSlotSize
implicitWidth: implicitHeight
BorderImage {
id: borderFrame
anchors.fill: parent
readonly property int borderWidth: 1
border { left: borderWidth; right: borderWidth; top: borderWidth; bottom: borderWidth }
source: root.isUsed > 0 ? "/images/1pixel-down-frame.png" : "/images/1pixel-up-frame.png"
horizontalTileMode: BorderImage.Repeat
verticalTileMode: BorderImage.Repeat
Image {
anchors.fill: parent
anchors.margins: borderFrame.borderWidth
source: "image://imbuement-icons/" + root.iconID
} //Image
} //BorderImage
TibiaText {
id: remainingTimeText
anchors { left: parent.left; right: parent.right; top: parent.top; leftMargin: -1 }
styleType: { "InventoryOverlay"
if (root.visualization == TibiaEnums.AlmostGone) {
return "RemainingTimeAlmostGone";
} else if (root.visualization == TibiaEnums.Used) {
return "RemainingTimeUsed";
}
return "RemainingTimeAlmostNew";
} //styleType
style: Text.Outline
horizontalAlignment: Text.AlignHCenter
visible: root.isUsed
font: slotTextItemSizeMeasurement.truncated ? TibiaStyle.defaultTightFont : TibiaStyle.defaultTextFont
TibiaText {
id: slotTextItemSizeMeasurement
anchors.fill: parent
visible: false
text: parent.text
styleType: parent.styleType
style: parent.style
horizontalAlignment: parent.horizontalAlignment
font: TibiaStyle.defaultTextFont
} //TibiaText
} //TibiaText
Tooltip {
anchors.fill: parent
maxWidth: TibiaStyle.guiHelpTooltipWidth
text: root.isUsed
? "%1\n\n%2 %3"
.arg(root.name)
.arg(qsTrId("imbuing_time_remaining"))
.arg(root.remainingTime)
: qsTrId("imbuement_tracker_empty_slot")
} //Tooltip
} //Item