Index: sources/gui/qml/components/ModalDialog.qml =================================================================== diff -u -rc0dfe1c7bc5f1664d0d8b3fc0cd47282095539b3 -rbd476995001c165188e4c86010bf8b0505d2ca35 --- sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision c0dfe1c7bc5f1664d0d8b3fc0cd47282095539b3) +++ sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision bd476995001c165188e4c86010bf8b0505d2ca35) @@ -1,21 +1,21 @@ /*! * - * 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 + * Copyright (c) 2019-2022 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file ModalDialog.qml - * \date 2019/10/21 - * \author Behrouz NematiPour + * \author (last) Behrouz NematiPour + * \date (last) 18-Jun-2021 + * \author (original) Behrouz NematiPour + * \date (original) 21-Oct-2019 * */ // Qt import QtQuick 2.12 -import QtQuick.Controls 2.12 -import QtGraphicalEffects 1.0 +import QtQuick.Controls 2.12 // Dialog // Project // Qml imports @@ -25,27 +25,33 @@ * \brief The parent item for modal dialogs */ Dialog { id : _root - property bool autoHide : false - property int autoHideDuration : 1000 + contentItem.objectName: "ModalDialog" //SquishQt testability - width : Variables.poweroffWidth - height : Variables.poweroffHeight + property bool autoHide : false + property int autoHideDuration : 1000 + property alias backgroundColor : _backgroundRect.color + property alias textColor : _notification.textColor + property alias border : _backgroundRect.border + property alias radius : _backgroundRect.radius + property alias notificationText : _notification.text + property alias notification : _notification + + width : Variables.dialogWidth + height : Variables.dialogHeight + 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 } } + enter: Transition { NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 200 } } + exit : Transition { NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 200 } } modal: true - Component { id: _rectOverlay - Rectangle { id : _borderRect - anchors.fill: parent - color: Colors.borderDialog - } - } closePolicy: Dialog.NoAutoClose - Overlay.modal : _rectOverlay + Overlay.modal : Rectangle { id : _borderRect + anchors.fill: parent + color: Colors.borderDialog + } background: Rectangle { id: _backgroundRect color : Colors.backgroundDialog @@ -55,7 +61,6 @@ onVisibleChanged: { if (autoHide && visible) { _autoHideAnimation.start() - console.debug("_autoHideAnimation started") } } @@ -66,8 +71,9 @@ duration: autoHideDuration //easing.type: Easing.InOutQuad onFinished: { - console.debug("_autoHideAnimation finished") _root.visible = false } } + + NotificationBarSmall { id: _notification } }