import QtQuick 2.12
import QtQuick.Controls 2.12 as Controls

import Palette 1.0

Controls.Button {
    id: control

    leftPadding: 12
    rightPadding: 12
    topPadding: 8
    bottomPadding: 8

    property color backgroundColor: Palette.blueButtonColor

    contentItem: Text {
        text: control.text
        font: control.font
        opacity: enabled ? 1.0 : 0.3
        color: Palette.alternativeTextColor
        horizontalAlignment: Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter
        elide: Text.ElideRight
    }

    background: Rectangle {
        color: control.pressed ? Qt.darker(control.backgroundColor, 1.4) :
                                 control.backgroundColor
        radius: 8
    }
}
