import QtQuick 2.12
import BTPhone 1.0
import QtQuick.Layouts 1.11
import QtQuick.Controls 2.15

Button {
    width: Constants.width * 0.3
    height: 40
    property alias menuItemCheckChecked: menuItemCheck.checked
    enabled: activated

    RowLayout {
        id: menuItemLayout
        anchors.fill: parent
        anchors.leftMargin: 10

        CheckBox {
            id: menuItemCheck
            width: 30
            height: 30
            visible: isCheckable
            checked: check
        }

        Text {
            id: menuItemName
            text: name
            font.pixelSize: 15
            verticalAlignment: Text.AlignVCenter
            Layout.fillHeight: true
            Layout.fillWidth: true
        }
    }

    Rectangle {
        id: rectangle
        opacity: 0.8
        visible: !parent.enabled
        color: "#c2c2c2"
        anchors.fill: parent
    }

    onClicked: if (isCheckable)
                   (menuItemCheck.checked = menuItemCheck.checked ? false : true)
}

/*##^##
Designer {
    D{i:4}
}
##^##*/

