diff --git a/NotifyModule/NotificationForm.qml b/NotifyModule/NotificationForm.qml index 430088d..01e470c 100644 --- a/NotifyModule/NotificationForm.qml +++ b/NotifyModule/NotificationForm.qml @@ -18,15 +18,20 @@ BasePopUp { property string titleText: qsTr("Message") property int type: 0 - function _getBackGraundColor(type) { + readonly property string defImgI: "qrc:/icons/info" + readonly property string defImgW: "qrc:/icons/warning" + readonly property string defImgE: "qrc:/icons/error" + + function getDefaultImage(type) { switch(type) { - case 1: return "#FFC107" - case 2: return "#FF5722" + case 1: return defImgW + case 2: return defImgE } - return Material.background + return defImgI + } autoClose: true; @@ -37,7 +42,7 @@ BasePopUp { spacing: 0 - backgroundColor: _getBackGraundColor(type); + backgroundColor: Material.background contentItem: Item { @@ -105,9 +110,5 @@ BasePopUp { } } - - header: Label { - text: titleText - horizontalAlignment: Text.AlignHCenter - } + title: titleText } diff --git a/NotifyModule/NotificationServiceView.qml b/NotifyModule/NotificationServiceView.qml index f937319..1a1c228 100644 --- a/NotifyModule/NotificationServiceView.qml +++ b/NotifyModule/NotificationServiceView.qml @@ -26,7 +26,7 @@ Item { id: notyfyView titleText : msg.title; text: (msg)? msg.text: ""; - img: (msg)? msg.img: ""; + img: (msg && msg.img.length)? msg.img: getDefaultImage((msg)? msg.type: 0); type: (msg)? msg.type: 0; x: parent.width - width - margin; @@ -40,7 +40,7 @@ Item { id: questionMsgBox titleText : qst.title; text: (qst)? qst.text: ""; - img: (qst)? qst.img: ""; + img: (qst && qst.img.length)? qst.img: defImg; type: 0; x: parent.width / 2 - width / 2; diff --git a/NotifyModule/YesNoQuestion.qml b/NotifyModule/YesNoQuestion.qml index 7adf558..d430648 100644 --- a/NotifyModule/YesNoQuestion.qml +++ b/NotifyModule/YesNoQuestion.qml @@ -6,6 +6,8 @@ import QtQuick.Layouts 1.15 NotificationForm { id: questionDialog + readonly property string defImg: "qrc:/icons/question" + autoClose: false clickClose: false diff --git a/QML.qrc b/QML.qrc index b988579..d3fcd40 100644 --- a/QML.qrc +++ b/QML.qrc @@ -7,4 +7,10 @@ NotifyModule/Metrix.qml NotifyModule/YesNoQuestion.qml + + icons/Warning.png + icons/Question.png + icons/Info.png + icons/Error.png + diff --git a/icons/Error.png b/icons/Error.png new file mode 100644 index 0000000..2bf6c4b Binary files /dev/null and b/icons/Error.png differ diff --git a/icons/Info.png b/icons/Info.png new file mode 100644 index 0000000..219ce0f Binary files /dev/null and b/icons/Info.png differ diff --git a/icons/Question.png b/icons/Question.png new file mode 100644 index 0000000..233631d Binary files /dev/null and b/icons/Question.png differ diff --git a/icons/Warning.png b/icons/Warning.png new file mode 100644 index 0000000..39c1859 Binary files /dev/null and b/icons/Warning.png differ