mirror of
https://github.com/QuasarApp/SimpleQmlNotify.git
synced 2025-04-26 13:44:34 +00:00
added default icons
This commit is contained in:
parent
0964928742
commit
f6bc28041e
@ -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
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -6,6 +6,8 @@ import QtQuick.Layouts 1.15
|
||||
NotificationForm {
|
||||
id: questionDialog
|
||||
|
||||
readonly property string defImg: "qrc:/icons/question"
|
||||
|
||||
autoClose: false
|
||||
clickClose: false
|
||||
|
||||
|
6
QML.qrc
6
QML.qrc
@ -7,4 +7,10 @@
|
||||
<file>NotifyModule/Metrix.qml</file>
|
||||
<file>NotifyModule/YesNoQuestion.qml</file>
|
||||
</qresource>
|
||||
<qresource prefix="/icons">
|
||||
<file alias="warning">icons/Warning.png</file>
|
||||
<file alias="question">icons/Question.png</file>
|
||||
<file alias="info">icons/Info.png</file>
|
||||
<file alias="error">icons/Error.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
BIN
icons/Error.png
Normal file
BIN
icons/Error.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 70 KiB |
BIN
icons/Info.png
Normal file
BIN
icons/Info.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 70 KiB |
BIN
icons/Question.png
Normal file
BIN
icons/Question.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 68 KiB |
BIN
icons/Warning.png
Normal file
BIN
icons/Warning.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
Loading…
x
Reference in New Issue
Block a user