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