moment/src/qml/Base/HIcon.qml

32 lines
698 B
QML
Raw Normal View History

import QtQuick 2.12
2019-09-13 07:27:26 +10:00
import QtGraphicalEffects 1.12
2019-09-13 07:27:26 +10:00
Image {
id: icon
cache: true
asynchronous: true
fillMode: Image.PreserveAspectFit
visible: Boolean(svgName)
source:
svgName ?
("../../icons/" + (theme ? theme.icons.preferredPack : "thin") +
"/" + svgName + ".svg") :
""
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
}
}