/*!
 *
 * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved.
 * \copyright                                                       \n
 *          THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM,  \n
 *          IN PART OR IN WHOLE,                                    \n
 *          WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n
 *
 * \file    RangeMarker.qml
 * \date    2020/01/22
 * \author  Behrouz NematiPour
 *
 */

// Qt
import QtQuick 2.12
import QtQuick.Controls 2.12

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

/*!
 * \brief   Denali project simple logo (No 'Diality')
 */
Item { id : _root
    property int   value        : 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   : Colors.textRangeMarker
        text    : value
    }
}
