2019-07-13 19:39:01 +10:00
|
|
|
import QtQuick 2.12
|
2019-09-13 07:27:26 +10:00
|
|
|
import QtGraphicalEffects 1.12
|
2019-04-27 11:16:45 +10:00
|
|
|
|
2019-09-13 07:27:26 +10:00
|
|
|
Image {
|
|
|
|
id: icon
|
|
|
|
cache: true
|
|
|
|
asynchronous: true
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2019-08-29 06:30:48 +10:00
|
|
|
visible: Boolean(svgName)
|
|
|
|
|
2019-07-24 16:14:34 +10:00
|
|
|
source:
|
|
|
|
svgName ?
|
2019-08-29 06:30:48 +10:00
|
|
|
("../../icons/" + (theme ? theme.icons.preferredPack : "thin") +
|
2019-08-28 09:47:58 +10:00
|
|
|
"/" + svgName + ".svg") :
|
2019-07-24 16:14:34 +10:00
|
|
|
""
|
|
|
|
|
2019-04-27 11:16:45 +10:00
|
|
|
sourceSize.width: svgName ? dimension : 0
|
|
|
|
sourceSize.height: svgName ? dimension : 0
|
2019-09-13 07:27:26 +10:00
|
|
|
|
|
|
|
|
|
|
|
property string svgName: ""
|
|
|
|
property int dimension: 20
|
|
|
|
property color colorize: theme.icons.colorize
|
|
|
|
|
|
|
|
|
|
|
|
layer.enabled: ! Qt.colorEqual(colorize, "transparent")
|
|
|
|
layer.effect: ColorOverlay {
|
|
|
|
color: icon.colorize
|
|
|
|
cached: icon.cache
|
|
|
|
}
|
2019-04-27 11:16:45 +10:00
|
|
|
}
|