2021-04-26 12:50:13 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtGraphicalEffects 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2021-04-26 12:50:13 +00:00
|
|
|
|
|
|
|
Image {
|
|
|
|
property string icon: ""
|
|
|
|
property color color
|
|
|
|
|
|
|
|
id: root
|
|
|
|
width: 24
|
|
|
|
height: 24
|
|
|
|
sourceSize.width: width
|
|
|
|
sourceSize.height: height
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
|
|
|
|
onIconChanged: {
|
|
|
|
if (icon !== "") {
|
2021-09-28 15:04:06 +00:00
|
|
|
source = Style.icon(icon);
|
2021-04-26 12:50:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ColorOverlay {
|
|
|
|
visible: root.color !== undefined
|
|
|
|
anchors.fill: root
|
|
|
|
source: root
|
|
|
|
color: root.color
|
|
|
|
antialiasing: true
|
|
|
|
smooth: true
|
|
|
|
rotation: root.rotation
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|