-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathIconInactive.qml
41 lines (40 loc) · 998 Bytes
/
IconInactive.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
// ekke (Ekkehard Gentz) @ekkescorner
import QtQuick 2.9
Image {
property string imageName: ""
onImageNameChanged: {
calculatePath()
}
property int imageSize: 0
onImageSizeChanged: {
if(imageName.length > 0) {
calculatePath()
}
}
//trick: to be triggered if folder changed
property string currentIconFolder: iconFolder
onCurrentIconFolderChanged: {
if(imageName.length > 0) {
calculatePath()
}
}
opacity: iconInactiveOpacity
function calculatePath() {
var path = "qrc:/images/"+currentIconFolder
switch(imageSize) {
case 18:
path += "/x18/"
break;
case 36:
path += "/x36/"
break;
case 48:
path += "/x48/"
break;
default:
path += "/"
} // switch
path += imageName
source = path
}
}