-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDynamicallyLoadedMultiImage.qml
More file actions
54 lines (44 loc) · 1.56 KB
/
DynamicallyLoadedMultiImage.qml
File metadata and controls
54 lines (44 loc) · 1.56 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
import QtQuick
import qmlcomponents
/*
* Developer hints for using DynamicallyLoadedMultiImage
*
* This Item needs to be 32x32 or 64x64 do work properly
* best use property smallSize32 or bigSize64
*/
Item {
id: icon
property alias dynamicallyLoadedImageManager: dynImage.dynamicallyLoadedImageManager
property var imageIdentifiers: []
property int currentImageIndex: 0
property alias smallSize32: dynImage.smallSize32
property alias bigSize64: dynImage.bigSize64
onImageIdentifiersChanged: {
currentImageIndex = 0;
} //onImageIdentifiersChanged
DynamicallyLoadedImage {
id: dynImage
anchors.fill: parent
imageKey: icon.currentImageIndex > -1
&& icon.currentImageIndex < icon.imageIdentifiers.length
? icon.imageIdentifiers[icon.currentImageIndex] : "";
} //DynamicallyLoadedImage
TibiaIconButton {
sourceUp: "/images/skin/classic/button-storeimage-previous-up.png"
sourceDown: "/images/skin/classic/button-storeimage-previous-down.png"
anchors { right: parent.left; bottom: parent.bottom; }
visible: icon.currentImageIndex > 0
onClicked: {
icon.currentImageIndex -= 1;
} //onClicked
} //TibiaIconButton
TibiaIconButton {
sourceUp: "/images/skin/classic/button-storeimage-next-up.png"
sourceDown: "/images/skin/classic/button-storeimage-next-down.png"
anchors { left: parent.right; bottom: parent.bottom; }
visible: icon.currentImageIndex < icon.imageIdentifiers.length - 1
onClicked: {
icon.currentImageIndex += 1;
} //onClicked
} //TibiaIconButton
} // Item