/*!
 *
 * Copyright (c) 2020-2023 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    RangeMarker.qml
 * \author  (last)      Behrouz NematiPour
 * \date    (last)      16-Oct-2020
 * \author  (original)  Behrouz NematiPour
 * \date    (original)  27-Jan-2020
 *
 */

// Qt
import QtQuick 2.12

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

/*!
 * \brief   Denali project simple logo (No 'Diality')
 */
Item { id : _root
    property real  value        : 0
    property int   decimal      : 0

    property alias text         : _textValue
    property color color        : Colors.rangeMarker
    property alias thickness    : _root.width
    property alias hasHandle    : _handle.visible

    height: parent.height
    width : Variables.rangeMarkerWidth

    anchors {
        bottom  : parent.bottom
    }

    Rectangle { id: _handle
        visible : false

        width   : _root.width * 3
        height  : _root.width * 3
        radius  : _root.width * 3
        color   : _root.color
        anchors {
            top : _root.top
            horizontalCenter: parent.horizontalCenter
        }
    }

    Rectangle { id: _stick
        width   : _root.width
        height  : _root.height
        color   : _root.color
        anchors {
            top : _root.top
            horizontalCenter: parent.horizontalCenter
        }
    }

    Text { id: _textValue
        font {
            pixelSize   : Fonts.fontPixelRangeMarker
            bold        : true
        }
        anchors {
            right  : parent.left
            top    : parent.top
            rightMargin:  5
            topMargin  : -5
        }
        color   : _root.color
        text    : value.toFixed(decimal)
    }
}
