2018-12-10 14:18:10 +01:00

57 lines
1.1 KiB
QML

// Copyright (c) 2018 Ultimaker B.V.
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtGraphicalEffects 1.0
Item
{
id: icon
width: parent.height
height: width
property var color: "transparent"
property var iconSource
property bool animated: false
Image
{
id: iconImage
width: parent.height
height: width
smooth: true
source: icon.iconSource
sourceSize.width: width
sourceSize.height: height
antialiasing: true
visible: !icon.animated
}
AnimatedImage
{
id: animatedIconImage
width: parent.height
height: width
smooth: true
antialiasing: true
source: "../images/loading.gif"
visible: icon.animated
}
ColorOverlay
{
anchors.fill: iconImage
source: iconImage
color: icon.color
antialiasing: true
visible: !icon.animated
}
ColorOverlay
{
anchors.fill: animatedIconImage
source: animatedIconImage
color: icon.color
antialiasing: true
visible: icon.animated
}
}