ImageStatus.qml 736 Bytes
Newer Older
Black Hat's avatar
Black Hat committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
import QtQuick 2.10
import QtQuick.Controls 2.3
import QtGraphicalEffects 1.0

Image {
    id: avatar

    mipmap: true
    layer.enabled: true
    fillMode: Image.PreserveAspectCrop

    layer.effect: OpacityMask {
        maskSource: Item {
            width: avatar.width
            height: avatar.width
            Rectangle {
                anchors.centerIn: parent
                width: avatar.width
                height: avatar.width
                radius: avatar.width / 2
            }
        }
    }

    Rectangle {
        id: circle
        width: avatar.width
        height: avatar.width
        radius: avatar.width / 2
        color: "transparent"
        border.color: "#4caf50"
        border.width: 4
    }
}