-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathImbuementTrackerWidget.qml
More file actions
135 lines (108 loc) · 4.66 KB
/
Copy pathImbuementTrackerWidget.qml
File metadata and controls
135 lines (108 loc) · 4.66 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
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
126
127
128
129
130
131
132
133
134
135
import QtQuick
import QtQuick.Layouts
import qmlcomponents
TibiaSidebarWidget {
id: root
caption: qsTrId("imbuement_tracker_widget_caption")
picSource: "/images/skin/classic/icon-imbuementtracker-widget.png"
readonly property int maxImbueableSlots: 6
readonly property int containerSlotOuterSize: TibiaStyle.containerSlotSize + TibiaStyle.containerSlotsMargin
minContentHeight: containerSlotOuterSize + header.height
maxContentHeight: containerSlotOuterSize * maxImbueableSlots + header.height + footer.height
initialContentHeight: 200
customButtonContainerData: [
TibiaIconButton {
id: contextMenuButton
sourceUp: "/images/skin/classic/button-contextmenu-12x12-idle.png"
sourceDown: "/images/skin/classic/button-contextmenu-12x12-pressed.png"
tooltipText: qsTrId("imbuementtrackerwidget_configure_tooltip")
onClicked: widgetController != null ? widgetController.optionsContextMenu() : undefined
} //TibiaIconButton
] //customButtonContainerData
TibiaScrollView {
id: scrollView
anchors.fill: parent
Flickable {
interactive: false //prevent flick behavior on touch screens
boundsBehavior: Flickable.StopAtBounds
contentHeight: contentLayout.height
contentWidth: parent.width
ColumnLayout {
id: contentLayout
anchors { left: parent.left; right: parent.right }
spacing: 0
Item {
id: header
Layout.fillWidth: true
Layout.preferredHeight: TibiaStyle.containerContentTopMargin
} //Item
ListView {
id: inventoryImbuementListView
Layout.fillWidth: true
Layout.leftMargin: TibiaStyle.containerContentLeftMargin
Layout.preferredHeight: contentHeight
spacing: TibiaStyle.containerSlotsMargin
model: widgetController != null ? widgetController.imbuedObjectsModel : null
interactive: false //prevent flick behavior on touch screens
boundsBehavior: Flickable.StopAtBounds
delegate: RowLayout {
spacing: TibiaStyle.containerSlotsMargin
ContainerSlot {
slotID: model.inventoryPosition
managedContainerTooltipText: model.managedContainerTooltip
objectAppearanceInstanceTypeId: model.typeID
objectAppearanceInstanceUpgradeTier: model.upgradeTier
objectAppearanceInstanceCumulativeCount: model.cumulativeCount
objectAppearanceInstanceLiquidType: model.liquideType
objectAppearanceInstanceHookDirection: model.hookDirection
slotText: model.alternativeSlotString.length > 0 ? model.alternativeSlotString : (model.cumulativeCount > 1 ? model.cumulativeCount : "")
onClicked: (SlotID, MouseButton, KeyboardModifier) => {
if (widgetController != null) {
widgetController.onObjectClicked(
SlotID,
MouseButton,
KeyboardModifier);
}
} //onClicked
} //ContainerSlot
ImbuementInfoLayout {
enabled: model.slotCount >= 1
opacity: enabled ? 1 : 0
iconID: model.imbuement1IconID
name: model.imbuement1Name
remainingTime: model.imbuement1RemainingTimeString
visualization: model.imbuement1Visualization
} //ImbuementInfoLayout
ImbuementInfoLayout {
enabled: model.slotCount >= 2
opacity: enabled ? 1 : 0
iconID: model.imbuement2IconID
name: model.imbuement2Name
remainingTime: model.imbuement2RemainingTimeString
visualization: model.imbuement2Visualization
} //ImbuementInfoLayout
ImbuementInfoLayout {
enabled: model.slotCount >= 3
opacity: enabled ? 1 : 0
iconID: model.imbuement3IconID
name: model.imbuement3Name
remainingTime: model.imbuement3RemainingTimeString
visualization: model.imbuement3Visualization
} //ImbuementInfoLayout
} //delegate RowLayout
} //ListView
Item {
id: footer
Layout.fillWidth: true
Layout.preferredHeight: TibiaStyle.containerContentBottomMargin
} //Item
} //ColumnLayout
} //Flickable
} //TibiaScrollView
Lenshelp {
anchors.fill: parent
triggerRect: mapFromItem(widgetRoot, 0, 0, widgetRoot.width, widgetRoot.height)
caption: qsTrId("imbuementtrackerwidget_lenshelp_caption")
content: qsTrId("imbuementtrackerwidget_lenshelp")
} //Lenshelp
} // TibiaSidebarWidget