/*!
 *
 * Copyright (c) 2019-2020 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    PreTreatmentConfirm.qml
 * \author  (last)      Behrouz NematiPour
 * \date    (last)      01-Mar-2021
 * \author  (original)  Peter Lucia
 * \date    (original)  03-Aug-2020
 *
 */

// Qt
import QtQuick 2.12
import QtQuick.Controls 2.12 // ScrollBar

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

/*!
 * \brief   Pre-Treatment confirm screen
 * \details which contains the user set values in a table to be confirmed by user.
 */
PreTreatmentBase { id: _root
    objectName: "_PreTreatmentConfirm"

    header.confirmEnabled: _flickable.atYEnd

    Flickable { id: _flickable
        objectName: "_PreTreatmentConfirmFlickable"
        anchors {
            top             : _root.title.bottom
            topMargin       : 15
            bottom          : _root.bottom
            bottomMargin    : Variables.notificationHeight + 15
            horizontalCenter: parent.horizontalCenter
        }
        width           : _root.width
        contentWidth    : _root.width
        contentHeight   : _column.implicitHeight
        clip: true

        ScrollBar.vertical: ScrollBar { id: _scrollBar
            anchors.right: _flickable.right
            anchors.rightMargin: 3
            contentItem: Rectangle {
                color: Colors.backgroundRangeRect
                implicitWidth: 6
                radius: width / 2
                width: 3
            }
        }

        Column { id: _column
            spacing: Variables.treatmentSpacing
            anchors.horizontalCenter: parent.horizontalCenter;
            anchors.fill: parent;

            // insert the treatment information table here
            ConfirmTreatmentTable {
                anchors.horizontalCenter: parent.horizontalCenter
            }
        }
    }

    onVisibleChanged: _flickable.contentY = 0 // scroll back to top
}
