import QtQuick 2.12
import QtQuick.Controls 2.12 as Controls

import Palette 1.0

Controls.TextField {
    id: control

    readOnly: true
    selectByMouse: true
    implicitHeight: 34

    horizontalAlignment: Text.AlignRight
    verticalAlignment: Text.AlignVCenter

    topPadding: 4
    bottomPadding: 4
    leftPadding: 12
    rightPadding: 12 + Math.ceil(indicatorLabel.width) + (indicatorLabel.visible ? 12 : 0)

    font.family: "Roboto"
    font.pixelSize: 22
    font.weight: Font.Bold

    color: Palette.labelTextColor

    property string indicatorText

    background: Rectangle {
        radius: 8
        color: Palette.controlBackgroundColor
        border.width: 1
        border.color: Palette.borderColor

        width: control.width
        height: control.height

        Controls.Label {
            id: indicatorLabel
            visible: control.indicatorText.length > 0
            text: control.indicatorText

            anchors.right: parent.right
            anchors.rightMargin: 12
            anchors.bottom: parent.bottom
            anchors.bottomMargin: 6

            font.family: "Roboto"
            font.pixelSize: 17
            font.weight: Font.Normal

            color: Palette.descriptionTextColor
        }
    }
}
