/*!
 *
 * Copyright (c) 2021-2022 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    ScrollBar.qml
 * \author  (last)      Behrouz NematiPour
 * \date    (last)      06-May-2021
 * \author  (original)  Behrouz NematiPour
 * \date    (original)  06-May-2021
 *
 */

// Qt
import QtQuick 2.12


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

/*!
 * \brief   the ScrollBar Component
 */

Background { id: _root
    property Flickable flickable: undefined
    property alias scrollColor  : _scrollbar.color
    property alias backColor    : _root.color
    property real  scrollMargin : 0

    clip: true
    color   : Colors.transparent
    Rectangle { id: _scrollbar
        anchors {
            right       : _root.right
            rightMargin : _root.scrollMargin
        }
        width           : Variables.dialogRadius
        radius          : Variables.dialogRadius
        y               : ( flickable instanceof Flickable) ? flickable.height * flickable.visibleArea.yPosition     : 0
        height          : ( flickable instanceof Flickable) ? flickable.height * flickable.visibleArea.heightRatio   : 0
        color           : "#80696969" // half transparent dimgray
    }
}
