Index: sources/gui/qml/dialogs/NotificationDialog.qml =================================================================== diff -u --- sources/gui/qml/dialogs/NotificationDialog.qml (revision 0) +++ sources/gui/qml/dialogs/NotificationDialog.qml (revision 2b4a6140359e88481ab2c516f3af29aabc652cd1) @@ -0,0 +1,111 @@ +/*! + * + * 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 Notification.qml + * \date 2020/06/01 + * \author Peter Lucia + * + */ + +// Qt +import QtQuick 2.12 +import QtGraphicalEffects 1.12 + +// Project +// Qml imports +import "qrc:/globals" +import "qrc:/components" + +/*! + * \brief Contains the PowerOff Dialog Implementation + */ +ModalDialog { id : _root + property alias titleText : _title.text; + property alias description : _desc.text; + property alias titleBarBackground : _titleBar.color; + property alias okayBtn : _okay; + property alias dismissBtn : _dismiss; + + radius: 0; + Rectangle { + id: _titleBar; + color: Colors.backgroundAlarmTopBar; + height: _root.height / 4; + width: _root.width; + radius: _root.radius; + + Image { + id: _icon + source: "qrc:/images/alarm.svg" + anchors.horizontalCenter: _title.horizontalCenter + anchors.verticalCenter: _title.verticalCenter; + anchors.horizontalCenterOffset: -_title.width + Variables.dialogSVGIconOffset; + sourceSize.height: Variables.dialogSVGHeight; + sourceSize.width: Variables.dialogSVGWidth; + } + + ColorOverlay { + anchors.fill: _icon; + source: _icon; + color: _root.backgroundColor; + cached: true; + antialiasing: true; + } + + Text { id: _title + color: Colors.textMain + font.pixelSize: Fonts.fontPixelTitle + text: qsTr("Notification") + anchors.centerIn: _titleBar; + } + } + Text { + id: _desc + color: Colors.textMain + font.pixelSize: Fonts.fontPixelButton + anchors { + horizontalCenter: parent.horizontalCenter; + verticalCenter: parent.verticalCenter; + } + } + + Row { + id: _buttons + spacing: Variables.buttonSpacing; + anchors { + horizontalCenter: parent.horizontalCenter; + bottom: parent.bottom; + bottomMargin: Variables.dialogMargin / 2; + } + + TouchRect { id : _okay + width: _root.width / 3; + text.text: qsTr("OKAY") + borderColor: _root.textColor; + property var callback: (function() { + console.debug("Pressed OKAY..."); + }); + button.onPressed: { + _root.visible = false; + callback(); + } + } + TouchRect { id : _dismiss + width: _root.width / 3; + text.text: qsTr("DISMISS") + borderColor: _root.textColor; + property var callback: (function() { + console.debug("Pressed DISMISS..."); + }); + button.onPressed: { + _root.visible = false; + callback(); + } + } + } +}