qml: put FlatButtons in ButtonContainer where (potentially) more buttons are grouped
This commit is contained in:
@@ -337,39 +337,46 @@ ElDialog {
|
||||
}
|
||||
}
|
||||
|
||||
FlatButton {
|
||||
ButtonContainer {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr('Pay')
|
||||
icon.source: '../../icons/confirmed.png'
|
||||
enabled: invoice.invoiceType != Invoice.Invalid && invoice.canPay && !amountContainer.editmode
|
||||
onClicked: {
|
||||
if (invoice_key == '') // save invoice if not retrieved from key
|
||||
invoice.save_invoice()
|
||||
dialog.close()
|
||||
doPay() // only signal here
|
||||
}
|
||||
}
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr('Delete')
|
||||
icon.source: '../../icons/delete.png'
|
||||
visible: invoice_key != ''
|
||||
onClicked: {
|
||||
invoice.wallet.delete_invoice(invoice_key)
|
||||
dialog.close()
|
||||
}
|
||||
}
|
||||
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr('Save')
|
||||
icon.source: '../../icons/save.png'
|
||||
visible: invoice_key == ''
|
||||
enabled: invoice.canSave
|
||||
onClicked: {
|
||||
app.stack.push(Qt.resolvedUrl('Invoices.qml'))
|
||||
invoice.save_invoice()
|
||||
dialog.close()
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
text: qsTr('Pay')
|
||||
icon.source: '../../icons/confirmed.png'
|
||||
enabled: invoice.invoiceType != Invoice.Invalid && invoice.canPay && !amountContainer.editmode
|
||||
onClicked: {
|
||||
if (invoice_key == '') // save invoice if not retrieved from key
|
||||
invoice.save_invoice()
|
||||
dialog.close()
|
||||
doPay() // only signal here
|
||||
}
|
||||
}
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
text: qsTr('Delete')
|
||||
icon.source: '../../icons/delete.png'
|
||||
visible: invoice_key != ''
|
||||
onClicked: {
|
||||
invoice.wallet.delete_invoice(invoice_key)
|
||||
dialog.close()
|
||||
}
|
||||
}
|
||||
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
text: qsTr('Save')
|
||||
icon.source: '../../icons/save.png'
|
||||
visible: invoice_key == ''
|
||||
enabled: invoice.canSave
|
||||
onClicked: {
|
||||
app.stack.push(Qt.resolvedUrl('Invoices.qml'))
|
||||
invoice.save_invoice()
|
||||
dialog.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user