/*!
 *
 * Copyright (c) 2019-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    ModalDialog.qml
 * \date    2019/10/21
 * \author  Behrouz NematiPour
 *
 */

// Qt
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtGraphicalEffects 1.0

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

/*!
 * \brief   The parent item for modal dialogs
 */
Dialog { id : _root
    width   : Variables.poweroffWidth
    height  : Variables.poweroffHeight
    visible : false
    anchors.centerIn: parent

    enter: Transition { NumberAnimation { property: "opacity"; from: 0.0; to: 1.0 } }
    exit : Transition { NumberAnimation { property: "opacity"; from: 1.0; to: 0.0 } }

    modal: true
    Component { id: _rectOverlay
        Rectangle { id : _borderRect
            anchors.fill: parent
            color: Colors.borderDialog
        }
    }

    closePolicy: Dialog.NoAutoClose
    Overlay.modal : _rectOverlay

    background: Rectangle { id: _backgroundRect
        color : Colors.backgroundDialog
        radius: Variables.dialogRadius
    }
}
