/*!
 *
 * 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    ProgressBarEx.qml
 * \author  (last)      Behrouz NematiPour
 * \date    (last)      16-Oct-2020
 * \author  (original)  Behrouz NematiPour
 * \date    (original)  18-Mar-2020
 *
 */

// Qt
import QtQuick 2.12

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

/*!
 * \brief   Denali project ProgressBar
 */
ProgressBar { id: _root
    objectName  : "_progressBarEx"

    property alias valueEx: _progressRectEx.value

    width       : Variables.ultrafiltrationProgressBarWidth
    height      : Variables.ultraFiltrationProgressBarHeight
    minimum     : 0.0
    maximum     : 0.0
    color       : Colors.ufProgressBarFill
    radius      : Variables.ultrafiltrationProgressBarRadius

    minText {
        font {
            pixelSize   : Fonts.fontPixelUltrafiltrationMinMaxLabel
            weight      : Font.Normal
        }
        color           : Colors.progressBarMinMax
        text            : minimum.toFixed(_root.decimal) + " " + Variables.unitVolume
    }
    maxText {
        font {
            pixelSize   : minText.font.pixelSize
            weight      : minText.font.weight
        }
        color           : Colors.progressBarMinMax
        text            : maximum.toFixed(_root.decimal) + " " + Variables.unitVolume
    }

    marker {
        width           : Variables.ultrafiltrationRangeMarkerWidth
        height          : Variables.rangeMarkerHeight
        valueOnTop      : true
        decimal         : _root.decimal
        value           : _root.value
        text {
            anchors.bottomMargin: Variables.ultrafiltrationRangeMarkerTextMargin
            font {
                pixelSize: Fonts.fontPixelUltrafiltrationRangeMarker
                weight: Font.DemiBold
            }
        }
    }

    ProgressRect { id: _progressRectEx
        z       : 0 // ProgressBarEx z order in the gui
                    // to be ordred among the components of the parent (ProgressBar)
        visible : value
        color   : Colors.ufAdjustmentDeltaFill
        decimal : _root.decimal
        minimum : _root.minimum
        maximum : _root.maximum
        value   : _root.valueEx
        radius  : _root.radius
        margin  : 0
    }
}
