/*!
 *
 * Copyright (c) 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    TreatmentCreate.qml
 * \author (last) Peter Lucia
 * \date (last) 17-07-2020
 * \author (original) Behrouz NematiPour
 * \date (original) 27-Jan-2020
 *
 */

// Qt
import QtQuick 2.12
import QtQuick.Controls 2.12

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

/*!
 * \brief   ManagerHome is the screen
 * which is the default screen in the "Manager" stack
 */
ScreenItem { id: _root
    signal backClicked()
    signal continueClicked()
    backgroundRect.color: Colors.backgroundMainMenu

    TopMenuBarCreateTreatment { id: _topMenuBar
        anchors.top: parent.top
        anchors.left: parent.left
        width: parent.width
        onBackClicked: {
            _root.backClicked();

        }
        state: "prime"
    }


    Flickable { id: _flickable
        anchors.top: _topMenuBar.bottom
        anchors.left: parent.left
        anchors.bottom: parent.bottom
        width: parent.width
        contentWidth: parent.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;

            Text { id: _titleText
                anchors.horizontalCenter: parent.horizontalCenter;
                text: qsTr("Priming")
                color: Colors.textMain
                font.pixelSize: Fonts.fontPixelTitle
            }

            TouchRect {
                anchors.horizontalCenter: parent.horizontalCenter
                text.text: qsTr("CONTINUE TO TREATMENT")
                button.onClicked: {
                    _root.continueClicked()
                }
            }
        }
    }

    onVisibleChanged: {
        if (visible) {
            _mainMenu.hidden = true
        }
    }
}
