// Qt
import QtQuick 2.12

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


ScreenItem { id: _postModeScreen
    onVisibleChanged: {
        if (visible) {
            _headerBar.activeStack = null
            _mainMenu.hidden = true
        }
    }

    Image { id: _dialityLogo
        Behavior on opacity { OpacityAnimator { duration: 1000 } }
        opacity         : _postModeScreen.visible ? 1 : 0
        anchors.centerIn: parent
        anchors.verticalCenterOffset: Variables.notificationHeight * -1
        source          : "qrc:/images/iLogoDiality"
    }

    ProgressBar {
        minimum : 0
        maximum : vHDPOSTData.itemCount
        value   : _GuiView.useLogUnhandledOnly ? maximum : vHDPOSTData.itemIndex
        width   : _dialityLogo.width    + 50
        height  : 3
        progress.border.width: 0
        border.width: 0
        minText .visible: false
        maxText .visible: false
        marker  .visible: false
        anchors {
            top: _dialityLogo.bottom
            topMargin       : 15
            horizontalCenter: parent.horizontalCenter
        }
        color : _GuiView.useLogUnhandledOnly ? "red": Colors.highlightProgressBar
    }

    WaitDone { id: _hdWaitdone
        diameter: 100
        anchors {
            top: _dialityLogo.bottom
            topMargin: 100
            horizontalCenter: parent.horizontalCenter
        }
        visible : true
        // HD will pause for a few seconds before changing to stand-by mode
        // So we can show that POST has completed
        fail    : ! vHDPOSTData.doneResult
        done    :   vHDPOSTData.done
        pause   : ! _postModeScreen.visible
    }
}
