qml InvoiceDialog: merge status and userinfo
This commit is contained in:
@@ -38,6 +38,8 @@ Item {
|
||||
property color colorInfo: Material.accentColor
|
||||
property color colorWarning: 'yellow'
|
||||
property color colorError: '#ffff8080'
|
||||
property color colorProgress: '#ffffff80'
|
||||
property color colorDone: '#ff80ff80'
|
||||
|
||||
property color colorMine: "yellow"
|
||||
property color colorLightningLocal: "blue"
|
||||
|
||||
@@ -52,10 +52,18 @@ ElDialog {
|
||||
Layout.fillWidth: true
|
||||
Layout.bottomMargin: constants.paddingLarge
|
||||
visible: text
|
||||
text: invoice.userinfo
|
||||
iconStyle: invoice.status == Invoice.Failed || invoice.status == Invoice.Expired
|
||||
text: invoice.userinfo ? invoice.userinfo : invoice.status_str
|
||||
iconStyle: invoice.status == Invoice.Failed || invoice.status == Invoice.Unknown
|
||||
? InfoTextArea.IconStyle.Warn
|
||||
: InfoTextArea.IconStyle.Info
|
||||
: invoice.status == Invoice.Expired
|
||||
? InfoTextArea.IconStyle.Error
|
||||
: invoice.status == Invoice.Inflight || invoice.status == Invoice.Routing || invoice.status == Invoice.Unconfirmed
|
||||
? InfoTextArea.IconStyle.Progress
|
||||
: invoice.status == Invoice.Paid
|
||||
? InfoTextArea.IconStyle.Done
|
||||
: invoice.status == Invoice.Unpaid && invoice.expiration > 0
|
||||
? InfoTextArea.IconStyle.Pending
|
||||
: InfoTextArea.IconStyle.Info
|
||||
}
|
||||
|
||||
Label {
|
||||
@@ -85,34 +93,6 @@ ElDialog {
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr('Status')
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Image {
|
||||
Layout.preferredWidth: constants.iconSizeSmall
|
||||
Layout.preferredHeight: constants.iconSizeSmall
|
||||
source: invoice.status == Invoice.Expired
|
||||
? '../../icons/expired.png'
|
||||
: invoice.status == Invoice.Unpaid
|
||||
? '../../icons/unpaid.png'
|
||||
: invoice.status == Invoice.Failed || invoice.status == Invoice.Unknown
|
||||
? '../../icons/warning.png'
|
||||
: invoice.status == Invoice.Inflight || invoice.status == Invoice.Routing
|
||||
? '../../icons/status_waiting.png'
|
||||
: invoice.status == Invoice.Unconfirmed
|
||||
? '../../icons/unconfirmed.png'
|
||||
: invoice.status == Invoice.Paid
|
||||
? '../../icons/confirmed.png'
|
||||
: ''
|
||||
}
|
||||
Label {
|
||||
text: invoice.status_str
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.columnSpan: 2
|
||||
Layout.topMargin: constants.paddingSmall
|
||||
|
||||
@@ -8,7 +8,10 @@ TextHighlightPane {
|
||||
None,
|
||||
Info,
|
||||
Warn,
|
||||
Error
|
||||
Error,
|
||||
Progress,
|
||||
Pending,
|
||||
Done
|
||||
}
|
||||
|
||||
property alias text: infotext.text
|
||||
@@ -21,7 +24,11 @@ TextHighlightPane {
|
||||
? constants.colorWarning
|
||||
: iconStyle == InfoTextArea.IconStyle.Error
|
||||
? constants.colorError
|
||||
: constants.colorInfo
|
||||
: iconStyle == InfoTextArea.IconStyle.Progress
|
||||
? constants.colorProgress
|
||||
: iconStyle == InfoTextArea.IconStyle.Done
|
||||
? constants.colorDone
|
||||
: constants.colorInfo
|
||||
padding: constants.paddingXLarge
|
||||
|
||||
RowLayout {
|
||||
@@ -35,7 +42,13 @@ TextHighlightPane {
|
||||
? "../../../icons/warning.png"
|
||||
: iconStyle == InfoTextArea.IconStyle.Error
|
||||
? "../../../icons/expired.png"
|
||||
: ""
|
||||
: iconStyle == InfoTextArea.IconStyle.Progress
|
||||
? "../../../icons/unconfirmed.png"
|
||||
: iconStyle == InfoTextArea.IconStyle.Pending
|
||||
? "../../../icons/unpaid.png"
|
||||
: iconStyle == InfoTextArea.IconStyle.Done
|
||||
? "../../../icons/confirmed.png"
|
||||
: ""
|
||||
Layout.preferredWidth: constants.iconSizeMedium
|
||||
Layout.preferredHeight: constants.iconSizeMedium
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user