/*!
 *
 * Copyright (c) 2021-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    PreTreatmentConfirm.qml
 * \author  (last)      Behrouz NematiPour
 * \date    (last)      31-May-2023
 * \author  (original)  Behrouz NematiPour
 * \date    (original)  12-Jan-2021
 *
 */

// 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"

    // removed for now, since after removing the A/V Min/Max, scrolling is not needed
    // ScrollBar {
    //     backColor   : Colors.backgroundDialog
    //     flickable   : _flickable
    //     anchors.fill: _flickable
    //     anchors.rightMargin : Variables.minVGap2
    //     anchors.leftMargin  : Variables.minVGap2
    // }

    Flickable { id: _flickable
        objectName: "_PreTreatmentConfirmFlickable"
        interactive: false
        Background { // Used instead of ScrollBar background
            color   : Colors.backgroundDialog
            anchors.rightMargin : Variables.minVGap2
            anchors.leftMargin  : Variables.minVGap2
        }
        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

        Column { id: _column
            anchors.horizontalCenter: parent.horizontalCenter;
            anchors.fill: parent;

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

        // removed for now, since after removing the A/V Min/Max, scrolling is not needed
        // onAtYEndChanged: {
        //     if (_flickable.atYEnd) header.confirmEnabled = true
        // }
    }

    // removed fro now, since after removing the A/V Min/Max, scrolling is not needed
    // onVisibleChanged: {
    //     _flickable.contentY = 0 // scroll back to top
    //     header.confirmEnabled = false
    // }
}
