/*!
 *
 * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved.
 * \copyright
 * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN
 * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
 *
 * \file    DebugDataColumn.qml
 * \author  (last)      Behrouz NematiPour
 * \date    (last)      28-May-2023
 * \author  (original)  Behrouz NematiPour
 * \date    (original)  23-Aug-2020
 *
 */

// Qt
import QtQuick 2.12

// Project
import Gui.Actions 0.1;

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

Column { id: _root
    property var    model: []
    property var    label: []
    property string title: "Title"
    property int    fontPixelSizeTitle: Fonts.fontPixelDebugTitle
    property int    fontPixelSizeText : Fonts.fontPixelDebugText
    property int    fontPixelSizeLabel: Fonts.fontPixelDebugLabel

    property string textObjectName: "_DebugDataColumn"

    property int    horizontalAlignmentTitle: Text.AlignRight
    property int    horizontalAlignmentText : Text.AlignRight

    width       : 150
    spacing     : -10

    Text { id: _title
        text    : _root.title
        width   : _root.width
        horizontalAlignment: _root.horizontalAlignmentTitle
        color: Colors.textMain
        font.pixelSize: fontPixelSizeTitle
        font.underline: true
        bottomPadding: 5
        font.family: Fonts.fontFamilyFixed
    }

    Repeater { id: _repeater
        model: _root.model
        Text { id: _text
            objectName: _root.textObjectName + index
            text: modelData
            width: _root.width
            horizontalAlignment: _root.horizontalAlignmentText
            color: Colors.textMain
            font.pixelSize: fontPixelSizeText
            font.family: Fonts.fontFamilyFixed
            font.weight: Font.Light

            Text {
                objectName      : _root.textObjectName + "L" + index
                text            : (index < _root.label.length) ? _root.label[index] : ""
                color           : Colors.textMain
                font.pixelSize  : fontPixelSizeLabel
                anchors.baseline: parent.baseline
                anchors.left    : parent.right
                anchors.leftMargin: 10
                horizontalAlignment: Text.AlignLeft
                font.family: Fonts.fontFamilyFixed
            }
        }
    }
}
