// Qt
import QtQuick 2.15

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

ModalDialog { id: _root
    width           : Variables.adjustmentDialogWidth
    height          : Variables.adjustmentDialogHeight
    clip            : true

    readonly property bool show: vTreatmentDryBicartDisconnect.showDialog

    onShowChanged: _root.show ? _root.open() : _root.close()

    DryBicartDisconnect { id: _drainBicarbCartridge
        anchors {
            fill            : parent
            topMargin       : Variables.defaultMargin * 2
            bottomMargin    : Variables.notificationHeight + Variables.defaultMargin
        }

        isDialog            : true
        titleFont.pixelSize : Fonts.fontPixelSection
    }

    CloseButton { id : _closeButton
        onClicked : {
            _root.close()
        }
    }

    Connections { target: vTreatmentAdjustmentDryBicartDisconnect
        function onAdjustmentTriggered          ( vValue ) {
            if ( vTreatmentAdjustmentDryBicartDisconnect.adjustment_Accepted ) {
                _root.notificationText = ""
            } else {
                _root.notificationText = vTreatmentAdjustmentDryBicartDisconnect.text()
            }
        }
    }
}
