// Qt
import QtQuick 2.12

// Project
//  Qml imports
import "qrc:/globals"
import "qrc:/components"

Item { id: _root
    width   : _row.width
    height  : _row.height

    property int   subStepIndex         : 0
    property int   subStepsLength       : 0
    property int    spacing             : 5
    property bool   complete            : false

    Row { id: _row
        spacing: 5
        anchors.centerIn: parent

        Repeater { id: _repeater
            model: _root.subStepsLength

            Grid { id: _gridSteps
                rows            : 1
                columns         : 0
                rowSpacing      : _root.spacing
                columnSpacing   : _root.spacing
                verticalItemAlignment   : Grid.AlignVCenter
                horizontalItemAlignment : Grid.AlignHCenter

                Line { id   : _spacerLine
                    color   : _stepsBullet.color
                    visible : index !== 0 // do not show fist line onl lines inbetween bullets
                }
                StepBullet { id: _stepsBullet
                    complete            : _root.complete || _root.subStepIndex > 0 && index <  _root.subStepIndex - 1  // first index is used for the head/first bullet
                    current             : _root.subStepIndex > 0 && index === _root.subStepIndex - 1 // first index is used for the head/first bullet
                    showCompleteCheck   : false
                    diameter            : 13
                }
            }
        }
    }
}
