Index: sources/gui/qml/components/ModalDialog.qml =================================================================== diff -u -rc933552983a659ca4cc351ff4d43d07319adab1e -r4a6abe765f03feae8100ec660aa04aa218d4dfa3 --- sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision c933552983a659ca4cc351ff4d43d07319adab1e) +++ sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision 4a6abe765f03feae8100ec660aa04aa218d4dfa3) @@ -15,7 +15,6 @@ // Qt import QtQuick 2.12 import QtQuick.Controls 2.12 -import QtGraphicalEffects 1.0 // Project // Qml imports @@ -25,36 +24,47 @@ * \brief The parent item for modal dialogs */ Dialog { id : _root - property bool blurOverlay: false + property bool autoHide : false + property int autoHideDuration : 1000 - width : Variables.poweroffWidth - height: Variables.poweroffHeight - visible: false + 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 - } - } - Component { id: _blurOverlay - FastBlur { id : _borderRect - anchors.fill: parent - source: _mainItem - radius: 25 - } - } closePolicy: Dialog.NoAutoClose - Overlay.modal : blurOverlay ? _blurOverlay : _rectOverlay + Overlay.modal : Rectangle { id : _borderRect + anchors.fill: parent + color: Colors.borderDialog + } + background: Rectangle { id: _backgroundRect color : Colors.backgroundDialog radius: Variables.dialogRadius } + + onVisibleChanged: { + if (autoHide && visible) { + _autoHideAnimation.start() + console.debug("_autoHideAnimation started") + } + } + + NumberAnimation { id: _autoHideAnimation + running: false + target: _root + property: "opacity" + duration: autoHideDuration + //easing.type: Easing.InOutQuad + onFinished: { + console.debug("_autoHideAnimation finished") + _root.visible = false + } + } }