import QtQuick 2.0
import Ubuntu.Components 1.2
import QtQuick.Layouts 1.1
Item {
Layout.preferredWidth: units.gu(6)
Layout.preferredHeight: units.gu(6)
Icon {
id: avatarImage
objectName: "avatar"
anchors.fill: shape
source: "file:///tmp/img.png"
}
ShaderEffectSource {
id: source
anchors.centerIn: parent // Placed under shape, so it's hidden
sourceItem: avatarImage
width: 1
height: 1
hideSource: true
}
UbuntuShape {
id: shape
source: source
anchors.fill: parent
sourceFillMode: UbuntuShape.PreserveAspectCrop
}
}