import QtQuick
import QtQuick.Controls.Basic

Item {
    id: item
    required property string source
    property color color: Theme.foreground
    property int iconHeight: 15
    property int iconWidth: 15
    property var onClicked

    height: item.iconHeight
    width: item.iconWidth

    Button {
        anchors.centerIn: parent
        background: Rectangle {
            color: "transparent"
        }
        // FIX: onClicked doesn't work
        onClicked: if (item.onClicked)
            item.onClicked()
        icon.source: item.source
        icon.width: item.iconWidth
        icon.height: item.iconHeight
        icon.color: item.color
        enabled: item.onClicked ? true : false
    }
}
