import QtQuick
import QtQuick.Controls.Basic

Menu {
    id: menu

    topPadding: 2
    bottomPadding: 2

    background: Rectangle {
        implicitWidth: 200
        implicitHeight: 40
        color: Theme.card
        radius: Theme.radius
        border.color: Theme.softBorder
        border.width: 1
    }

    delegate: MenuItem {
        id: menuItem
        implicitWidth: 200
        implicitHeight: 40

        contentItem: AppText {
            leftPadding: menuItem.indicator.width
            rightPadding: menuItem.arrow.width
            text: menuItem.text
            opacity: enabled ? 1.0 : 0.3
            color: Theme.foreground
            horizontalAlignment: Text.AlignLeft
            verticalAlignment: Text.AlignVCenter
            elide: Text.ElideRight
        }

        background: Rectangle {
            implicitWidth: 200
            implicitHeight: 40
            opacity: enabled ? 1 : 0.3
            color: menuItem.highlighted ? Theme.highlight : "transparent"
        }
    }
}
