qml: make dialog content flickable for small displays for CloseChannelDialog, OpemChannelDialog and InvoiceDialog
This commit is contained in:
@@ -32,121 +32,129 @@ ElDialog {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
GridLayout {
|
Flickable {
|
||||||
id: layout
|
Layout.preferredWidth: parent.width
|
||||||
Layout.preferredWidth: parent.width - 2*constants.paddingLarge
|
Layout.fillHeight: true
|
||||||
Layout.leftMargin: constants.paddingLarge
|
|
||||||
Layout.rightMargin: constants.paddingLarge
|
|
||||||
columns: 2
|
|
||||||
|
|
||||||
Label {
|
leftMargin: constants.paddingLarge
|
||||||
Layout.fillWidth: true
|
rightMargin: constants.paddingLarge
|
||||||
visible: channeldetails.name
|
|
||||||
text: qsTr('Channel name')
|
|
||||||
color: Material.accentColor
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
contentHeight: rootLayout.height
|
||||||
Layout.fillWidth: true
|
clip:true
|
||||||
visible: channeldetails.name
|
interactive: height < contentHeight
|
||||||
text: channeldetails.name
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
GridLayout {
|
||||||
text: qsTr('Remote node ID')
|
id: rootLayout
|
||||||
Layout.columnSpan: 2
|
width: parent.width
|
||||||
color: Material.accentColor
|
columns: 2
|
||||||
}
|
|
||||||
|
|
||||||
TextHighlightPane {
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
Layout.fillWidth: true
|
|
||||||
padding: 0
|
|
||||||
leftPadding: constants.paddingSmall
|
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
width: parent.width
|
|
||||||
text: channeldetails.pubkey
|
|
||||||
font.pixelSize: constants.fontSizeLarge
|
|
||||||
font.family: FixedFont
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
wrapMode: Text.Wrap
|
visible: channeldetails.name
|
||||||
}
|
text: qsTr('Channel name')
|
||||||
}
|
color: Material.accentColor
|
||||||
|
|
||||||
Label {
|
|
||||||
text: qsTr('Short channel ID')
|
|
||||||
color: Material.accentColor
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
text: channeldetails.short_cid
|
|
||||||
}
|
|
||||||
|
|
||||||
Item { Layout.preferredHeight: constants.paddingMedium; Layout.preferredWidth: 1; Layout.columnSpan: 2 }
|
|
||||||
|
|
||||||
InfoTextArea {
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: qsTr(channeldetails.message_force_close)
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
text: qsTr('Choose closing method')
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
color: Material.accentColor
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
|
|
||||||
ButtonGroup {
|
|
||||||
id: closetypegroup
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RadioButton {
|
|
||||||
ButtonGroup.group: closetypegroup
|
|
||||||
property string closetype: 'cooperative'
|
|
||||||
checked: true
|
|
||||||
enabled: !closing && channeldetails.canCoopClose
|
|
||||||
text: qsTr('Cooperative close')
|
|
||||||
}
|
|
||||||
RadioButton {
|
|
||||||
ButtonGroup.group: closetypegroup
|
|
||||||
property string closetype: 'remote_force'
|
|
||||||
enabled: !closing && channeldetails.canForceClose
|
|
||||||
text: qsTr('Request Force-close')
|
|
||||||
}
|
|
||||||
RadioButton {
|
|
||||||
ButtonGroup.group: closetypegroup
|
|
||||||
property string closetype: 'local_force'
|
|
||||||
enabled: !closing && channeldetails.canForceClose && !channeldetails.isBackup
|
|
||||||
text: qsTr('Local Force-close')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
Label {
|
Label {
|
||||||
id: errorText
|
Layout.fillWidth: true
|
||||||
visible: !closing && errorText
|
visible: channeldetails.name
|
||||||
wrapMode: Text.Wrap
|
text: channeldetails.name
|
||||||
Layout.preferredWidth: layout.width
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr('Closing...')
|
text: qsTr('Remote node ID')
|
||||||
visible: closing
|
Layout.columnSpan: 2
|
||||||
|
color: Material.accentColor
|
||||||
}
|
}
|
||||||
BusyIndicator {
|
|
||||||
visible: closing
|
TextHighlightPane {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
padding: 0
|
||||||
|
leftPadding: constants.paddingSmall
|
||||||
|
|
||||||
|
Label {
|
||||||
|
width: parent.width
|
||||||
|
text: channeldetails.pubkey
|
||||||
|
font.pixelSize: constants.fontSizeLarge
|
||||||
|
font.family: FixedFont
|
||||||
|
Layout.fillWidth: true
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr('Short channel ID')
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: channeldetails.short_cid
|
||||||
|
}
|
||||||
|
|
||||||
|
Item { Layout.preferredHeight: constants.paddingMedium; Layout.preferredWidth: 1; Layout.columnSpan: 2 }
|
||||||
|
|
||||||
|
InfoTextArea {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: qsTr(channeldetails.message_force_close)
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr('Choose closing method')
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
|
ButtonGroup {
|
||||||
|
id: closetypegroup
|
||||||
|
}
|
||||||
|
|
||||||
|
RadioButton {
|
||||||
|
ButtonGroup.group: closetypegroup
|
||||||
|
property string closetype: 'cooperative'
|
||||||
|
checked: true
|
||||||
|
enabled: !closing && channeldetails.canCoopClose
|
||||||
|
text: qsTr('Cooperative close')
|
||||||
|
}
|
||||||
|
RadioButton {
|
||||||
|
ButtonGroup.group: closetypegroup
|
||||||
|
property string closetype: 'remote_force'
|
||||||
|
enabled: !closing && channeldetails.canForceClose
|
||||||
|
text: qsTr('Request Force-close')
|
||||||
|
}
|
||||||
|
RadioButton {
|
||||||
|
ButtonGroup.group: closetypegroup
|
||||||
|
property string closetype: 'local_force'
|
||||||
|
enabled: !closing && channeldetails.canForceClose && !channeldetails.isBackup
|
||||||
|
text: qsTr('Local Force-close')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
Label {
|
||||||
|
id: errorText
|
||||||
|
visible: !closing && errorText
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
Layout.preferredWidth: layout.width
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
text: qsTr('Closing...')
|
||||||
|
visible: closing
|
||||||
|
}
|
||||||
|
BusyIndicator {
|
||||||
|
visible: closing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
|
|
||||||
|
|
||||||
FlatButton {
|
FlatButton {
|
||||||
Layout.columnSpan: 2
|
Layout.columnSpan: 2
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|||||||
@@ -30,305 +30,313 @@ ElDialog {
|
|||||||
property bool _canMax: invoice.invoiceType == Invoice.OnchainInvoice
|
property bool _canMax: invoice.invoiceType == Invoice.OnchainInvoice
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
width: parent.width
|
anchors.fill: parent
|
||||||
height: parent.height
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
GridLayout {
|
Flickable {
|
||||||
id: layout
|
Layout.preferredWidth: parent.width
|
||||||
width: parent.width
|
Layout.fillHeight: true
|
||||||
Layout.leftMargin: constants.paddingLarge
|
|
||||||
Layout.rightMargin: constants.paddingLarge
|
|
||||||
columns: 2
|
|
||||||
|
|
||||||
Label {
|
leftMargin: constants.paddingLarge
|
||||||
text: qsTr('Type')
|
rightMargin: constants.paddingLarge
|
||||||
color: Material.accentColor
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
contentHeight: rootLayout.height
|
||||||
Layout.fillWidth: true
|
clip:true
|
||||||
Image {
|
interactive: height < contentHeight
|
||||||
Layout.preferredWidth: constants.iconSizeSmall
|
|
||||||
Layout.preferredHeight: constants.iconSizeSmall
|
GridLayout {
|
||||||
source: invoice.invoiceType == Invoice.LightningInvoice
|
id: rootLayout
|
||||||
? "../../icons/lightning.png"
|
width: parent.width
|
||||||
: "../../icons/bitcoin.png"
|
|
||||||
}
|
columns: 2
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: invoice.invoiceType == Invoice.OnchainInvoice
|
text: qsTr('Type')
|
||||||
? qsTr('On chain')
|
color: Material.accentColor
|
||||||
: invoice.invoiceType == Invoice.LightningInvoice
|
|
||||||
? qsTr('Lightning')
|
|
||||||
: ''
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
text: qsTr('Status')
|
|
||||||
color: Material.accentColor
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
text: invoice.status_str
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
visible: invoice.invoiceType == Invoice.OnchainInvoice
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
text: qsTr('Address')
|
|
||||||
color: Material.accentColor
|
|
||||||
}
|
|
||||||
|
|
||||||
TextHighlightPane {
|
|
||||||
visible: invoice.invoiceType == Invoice.OnchainInvoice
|
|
||||||
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
padding: 0
|
|
||||||
leftPadding: constants.paddingMedium
|
|
||||||
|
|
||||||
Label {
|
|
||||||
width: parent.width
|
|
||||||
text: invoice.address
|
|
||||||
font.family: FixedFont
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
visible: invoice.invoiceType == Invoice.LightningInvoice
|
|
||||||
text: qsTr('Remote Pubkey')
|
|
||||||
color: Material.accentColor
|
|
||||||
}
|
|
||||||
|
|
||||||
TextHighlightPane {
|
|
||||||
visible: invoice.invoiceType == Invoice.LightningInvoice
|
|
||||||
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
padding: 0
|
|
||||||
leftPadding: constants.paddingMedium
|
|
||||||
|
|
||||||
Label {
|
|
||||||
width: parent.width
|
|
||||||
text: 'pubkey' in invoice.lnprops ? invoice.lnprops.pubkey : ''
|
|
||||||
font.family: FixedFont
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
visible: invoice.invoiceType == Invoice.LightningInvoice
|
|
||||||
text: qsTr('Payment hash')
|
|
||||||
color: Material.accentColor
|
|
||||||
}
|
|
||||||
|
|
||||||
TextHighlightPane {
|
|
||||||
visible: invoice.invoiceType == Invoice.LightningInvoice
|
|
||||||
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
padding: 0
|
|
||||||
leftPadding: constants.paddingMedium
|
|
||||||
|
|
||||||
Label {
|
|
||||||
width: parent.width
|
|
||||||
text: 'payment_hash' in invoice.lnprops ? invoice.lnprops.payment_hash : ''
|
|
||||||
font.family: FixedFont
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
text: qsTr('Description')
|
|
||||||
visible: invoice.message
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
color: Material.accentColor
|
|
||||||
}
|
|
||||||
|
|
||||||
TextHighlightPane {
|
|
||||||
visible: invoice.message
|
|
||||||
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
|
|
||||||
padding: 0
|
|
||||||
leftPadding: constants.paddingMedium
|
|
||||||
|
|
||||||
Label {
|
|
||||||
text: invoice.message
|
|
||||||
width: parent.width
|
|
||||||
font.pixelSize: constants.fontSizeXLarge
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
elide: Text.ElideRight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
text: qsTr('Amount to send')
|
|
||||||
color: Material.accentColor
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
}
|
|
||||||
|
|
||||||
TextHighlightPane {
|
|
||||||
id: amountContainer
|
|
||||||
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
|
|
||||||
padding: 0
|
|
||||||
leftPadding: constants.paddingXXLarge
|
|
||||||
|
|
||||||
property bool editmode: false
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: amountLayout
|
Layout.fillWidth: true
|
||||||
width: parent.width
|
Image {
|
||||||
|
Layout.preferredWidth: constants.iconSizeSmall
|
||||||
GridLayout {
|
Layout.preferredHeight: constants.iconSizeSmall
|
||||||
visible: !amountContainer.editmode
|
source: invoice.invoiceType == Invoice.LightningInvoice
|
||||||
columns: 2
|
? "../../icons/lightning.png"
|
||||||
|
: "../../icons/bitcoin.png"
|
||||||
Label {
|
|
||||||
visible: invoice.amount.isMax
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
font.pixelSize: constants.fontSizeXLarge
|
|
||||||
font.bold: true
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: qsTr('All on-chain funds')
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
visible: !invoice.amount.isMax
|
|
||||||
font.pixelSize: constants.fontSizeXLarge
|
|
||||||
font.family: FixedFont
|
|
||||||
font.bold: true
|
|
||||||
text: Config.formatSats(invoice.amount, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
visible: !invoice.amount.isMax
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: Config.baseUnit
|
|
||||||
color: Material.accentColor
|
|
||||||
font.pixelSize: constants.fontSizeXLarge
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
id: fiatValue
|
|
||||||
visible: Daemon.fx.enabled && !invoice.amount.isMax
|
|
||||||
text: Daemon.fx.fiatValue(invoice.amount, false)
|
|
||||||
font.pixelSize: constants.fontSizeMedium
|
|
||||||
color: constants.mutedForeground
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
visible: Daemon.fx.enabled && !invoice.amount.isMax
|
|
||||||
Layout.fillWidth: true
|
|
||||||
text: Daemon.fx.fiatCurrency
|
|
||||||
font.pixelSize: constants.fontSizeMedium
|
|
||||||
color: constants.mutedForeground
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolButton {
|
Label {
|
||||||
visible: !amountContainer.editmode
|
text: invoice.invoiceType == Invoice.OnchainInvoice
|
||||||
icon.source: '../../icons/pen.png'
|
? qsTr('On chain')
|
||||||
icon.color: 'transparent'
|
: invoice.invoiceType == Invoice.LightningInvoice
|
||||||
onClicked: {
|
? qsTr('Lightning')
|
||||||
amountBtc.text = invoice.amount.satsInt == 0 ? '' : Config.formatSats(invoice.amount)
|
: ''
|
||||||
amountMax.checked = invoice.amount.isMax
|
|
||||||
amountContainer.editmode = true
|
|
||||||
amountBtc.focus = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GridLayout {
|
|
||||||
visible: amountContainer.editmode
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
columns: 3
|
|
||||||
BtcField {
|
|
||||||
id: amountBtc
|
|
||||||
fiatfield: amountFiat
|
|
||||||
enabled: !amountMax.checked
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
text: Config.baseUnit
|
|
||||||
color: Material.accentColor
|
|
||||||
Layout.fillWidth: amountMax.visible ? false : true
|
|
||||||
Layout.columnSpan: amountMax.visible ? 1 : 2
|
|
||||||
}
|
|
||||||
Switch {
|
|
||||||
id: amountMax
|
|
||||||
text: qsTr('Max')
|
|
||||||
visible: _canMax
|
|
||||||
Layout.fillWidth: true
|
|
||||||
checked: invoice.amount.isMax
|
|
||||||
onCheckedChanged: {
|
|
||||||
if (activeFocus) {
|
|
||||||
invoice.amount.isMax = checked
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FiatField {
|
|
||||||
id: amountFiat
|
|
||||||
btcfield: amountBtc
|
|
||||||
visible: Daemon.fx.enabled && !amountMax.checked
|
|
||||||
enabled: !amountMax.checked
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
visible: Daemon.fx.enabled && !amountMax.checked
|
|
||||||
text: Daemon.fx.fiatCurrency
|
|
||||||
color: Material.accentColor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ToolButton {
|
|
||||||
visible: amountContainer.editmode
|
|
||||||
Layout.fillWidth: false
|
|
||||||
icon.source: '../../icons/confirmed.png'
|
|
||||||
icon.color: 'transparent'
|
|
||||||
onClicked: {
|
|
||||||
amountContainer.editmode = false
|
|
||||||
invoice.amount = amountMax.checked ? MAX : Config.unitsToSats(amountBtc.text)
|
|
||||||
invoiceAmountChanged()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ToolButton {
|
|
||||||
visible: amountContainer.editmode
|
|
||||||
Layout.fillWidth: false
|
|
||||||
icon.source: '../../icons/closebutton.png'
|
|
||||||
icon.color: 'transparent'
|
|
||||||
onClicked: amountContainer.editmode = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
Label {
|
||||||
|
text: qsTr('Status')
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
|
||||||
Item { Layout.preferredHeight: constants.paddingLarge; Layout.preferredWidth: 1 }
|
Label {
|
||||||
|
text: invoice.status_str
|
||||||
|
}
|
||||||
|
|
||||||
InfoTextArea {
|
Label {
|
||||||
Layout.columnSpan: 2
|
visible: invoice.invoiceType == Invoice.OnchainInvoice
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.columnSpan: 2
|
||||||
Layout.preferredWidth: parent.width * 3/4
|
text: qsTr('Address')
|
||||||
visible: invoice.userinfo
|
color: Material.accentColor
|
||||||
text: invoice.userinfo
|
}
|
||||||
|
|
||||||
|
TextHighlightPane {
|
||||||
|
visible: invoice.invoiceType == Invoice.OnchainInvoice
|
||||||
|
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
padding: 0
|
||||||
|
leftPadding: constants.paddingMedium
|
||||||
|
|
||||||
|
Label {
|
||||||
|
width: parent.width
|
||||||
|
text: invoice.address
|
||||||
|
font.family: FixedFont
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: invoice.invoiceType == Invoice.LightningInvoice
|
||||||
|
text: qsTr('Remote Pubkey')
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
|
||||||
|
TextHighlightPane {
|
||||||
|
visible: invoice.invoiceType == Invoice.LightningInvoice
|
||||||
|
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
padding: 0
|
||||||
|
leftPadding: constants.paddingMedium
|
||||||
|
|
||||||
|
Label {
|
||||||
|
width: parent.width
|
||||||
|
text: 'pubkey' in invoice.lnprops ? invoice.lnprops.pubkey : ''
|
||||||
|
font.family: FixedFont
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: invoice.invoiceType == Invoice.LightningInvoice
|
||||||
|
text: qsTr('Payment hash')
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
|
||||||
|
TextHighlightPane {
|
||||||
|
visible: invoice.invoiceType == Invoice.LightningInvoice
|
||||||
|
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
padding: 0
|
||||||
|
leftPadding: constants.paddingMedium
|
||||||
|
|
||||||
|
Label {
|
||||||
|
width: parent.width
|
||||||
|
text: 'payment_hash' in invoice.lnprops ? invoice.lnprops.payment_hash : ''
|
||||||
|
font.family: FixedFont
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr('Description')
|
||||||
|
visible: invoice.message
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
|
||||||
|
TextHighlightPane {
|
||||||
|
visible: invoice.message
|
||||||
|
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
|
padding: 0
|
||||||
|
leftPadding: constants.paddingMedium
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: invoice.message
|
||||||
|
width: parent.width
|
||||||
|
font.pixelSize: constants.fontSizeXLarge
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
elide: Text.ElideRight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr('Amount to send')
|
||||||
|
color: Material.accentColor
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
}
|
||||||
|
|
||||||
|
TextHighlightPane {
|
||||||
|
id: amountContainer
|
||||||
|
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
|
padding: 0
|
||||||
|
leftPadding: constants.paddingXXLarge
|
||||||
|
|
||||||
|
property bool editmode: false
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: amountLayout
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
GridLayout {
|
||||||
|
visible: !amountContainer.editmode
|
||||||
|
columns: 2
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: invoice.amount.isMax
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
font.pixelSize: constants.fontSizeXLarge
|
||||||
|
font.bold: true
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: qsTr('All on-chain funds')
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: !invoice.amount.isMax
|
||||||
|
font.pixelSize: constants.fontSizeXLarge
|
||||||
|
font.family: FixedFont
|
||||||
|
font.bold: true
|
||||||
|
text: Config.formatSats(invoice.amount, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: !invoice.amount.isMax
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: Config.baseUnit
|
||||||
|
color: Material.accentColor
|
||||||
|
font.pixelSize: constants.fontSizeXLarge
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
id: fiatValue
|
||||||
|
visible: Daemon.fx.enabled && !invoice.amount.isMax
|
||||||
|
text: Daemon.fx.fiatValue(invoice.amount, false)
|
||||||
|
font.pixelSize: constants.fontSizeMedium
|
||||||
|
color: constants.mutedForeground
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: Daemon.fx.enabled && !invoice.amount.isMax
|
||||||
|
Layout.fillWidth: true
|
||||||
|
text: Daemon.fx.fiatCurrency
|
||||||
|
font.pixelSize: constants.fontSizeMedium
|
||||||
|
color: constants.mutedForeground
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ToolButton {
|
||||||
|
visible: !amountContainer.editmode
|
||||||
|
icon.source: '../../icons/pen.png'
|
||||||
|
icon.color: 'transparent'
|
||||||
|
onClicked: {
|
||||||
|
amountBtc.text = invoice.amount.satsInt == 0 ? '' : Config.formatSats(invoice.amount)
|
||||||
|
amountMax.checked = invoice.amount.isMax
|
||||||
|
amountContainer.editmode = true
|
||||||
|
amountBtc.focus = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GridLayout {
|
||||||
|
visible: amountContainer.editmode
|
||||||
|
Layout.fillWidth: true
|
||||||
|
columns: 3
|
||||||
|
BtcField {
|
||||||
|
id: amountBtc
|
||||||
|
fiatfield: amountFiat
|
||||||
|
enabled: !amountMax.checked
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: Config.baseUnit
|
||||||
|
color: Material.accentColor
|
||||||
|
Layout.fillWidth: amountMax.visible ? false : true
|
||||||
|
Layout.columnSpan: amountMax.visible ? 1 : 2
|
||||||
|
}
|
||||||
|
Switch {
|
||||||
|
id: amountMax
|
||||||
|
text: qsTr('Max')
|
||||||
|
visible: _canMax
|
||||||
|
Layout.fillWidth: true
|
||||||
|
checked: invoice.amount.isMax
|
||||||
|
onCheckedChanged: {
|
||||||
|
if (activeFocus) {
|
||||||
|
invoice.amount.isMax = checked
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FiatField {
|
||||||
|
id: amountFiat
|
||||||
|
btcfield: amountBtc
|
||||||
|
visible: Daemon.fx.enabled && !amountMax.checked
|
||||||
|
enabled: !amountMax.checked
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
visible: Daemon.fx.enabled && !amountMax.checked
|
||||||
|
text: Daemon.fx.fiatCurrency
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ToolButton {
|
||||||
|
visible: amountContainer.editmode
|
||||||
|
Layout.fillWidth: false
|
||||||
|
icon.source: '../../icons/confirmed.png'
|
||||||
|
icon.color: 'transparent'
|
||||||
|
onClicked: {
|
||||||
|
amountContainer.editmode = false
|
||||||
|
invoice.amount = amountMax.checked ? MAX : Config.unitsToSats(amountBtc.text)
|
||||||
|
invoiceAmountChanged()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ToolButton {
|
||||||
|
visible: amountContainer.editmode
|
||||||
|
Layout.fillWidth: false
|
||||||
|
icon.source: '../../icons/closebutton.png'
|
||||||
|
icon.color: 'transparent'
|
||||||
|
onClicked: amountContainer.editmode = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Item { Layout.preferredHeight: constants.paddingLarge; Layout.preferredWidth: 1 }
|
||||||
|
|
||||||
|
InfoTextArea {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
Layout.preferredWidth: parent.width * 3/4
|
||||||
|
visible: invoice.userinfo
|
||||||
|
text: invoice.userinfo
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
|
|
||||||
|
|
||||||
FlatButton {
|
FlatButton {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: qsTr('Pay')
|
text: qsTr('Pay')
|
||||||
|
|||||||
@@ -29,136 +29,144 @@ ElDialog {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
GridLayout {
|
Flickable {
|
||||||
id: form
|
Layout.preferredWidth: parent.width
|
||||||
Layout.fillWidth: true
|
Layout.fillHeight: true
|
||||||
Layout.leftMargin: constants.paddingLarge
|
|
||||||
Layout.rightMargin: constants.paddingLarge
|
|
||||||
|
|
||||||
columns: 4
|
leftMargin: constants.paddingLarge
|
||||||
|
rightMargin: constants.paddingLarge
|
||||||
|
|
||||||
Label {
|
contentHeight: rootLayout.height
|
||||||
text: qsTr('Node')
|
clip:true
|
||||||
color: Material.accentColor
|
interactive: height < contentHeight
|
||||||
}
|
|
||||||
|
|
||||||
// gossip
|
GridLayout {
|
||||||
TextArea {
|
id: rootLayout
|
||||||
id: node
|
width: parent.width
|
||||||
visible: Config.useGossip
|
|
||||||
Layout.columnSpan: 2
|
columns: 4
|
||||||
Layout.fillWidth: true
|
|
||||||
font.family: FixedFont
|
Label {
|
||||||
wrapMode: Text.Wrap
|
text: qsTr('Node')
|
||||||
placeholderText: qsTr('Paste or scan node uri/pubkey')
|
color: Material.accentColor
|
||||||
onActiveFocusChanged: {
|
|
||||||
if (!activeFocus)
|
|
||||||
channelopener.nodeid = text
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
// gossip
|
||||||
visible: Config.useGossip
|
TextArea {
|
||||||
spacing: 0
|
id: node
|
||||||
ToolButton {
|
visible: Config.useGossip
|
||||||
icon.source: '../../icons/paste.png'
|
Layout.columnSpan: 2
|
||||||
icon.height: constants.iconSizeMedium
|
Layout.fillWidth: true
|
||||||
icon.width: constants.iconSizeMedium
|
font.family: FixedFont
|
||||||
onClicked: {
|
wrapMode: Text.Wrap
|
||||||
if (channelopener.validate_nodeid(AppController.clipboardToText())) {
|
placeholderText: qsTr('Paste or scan node uri/pubkey')
|
||||||
channelopener.nodeid = AppController.clipboardToText()
|
onActiveFocusChanged: {
|
||||||
node.text = channelopener.nodeid
|
if (!activeFocus)
|
||||||
|
channelopener.nodeid = text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
visible: Config.useGossip
|
||||||
|
spacing: 0
|
||||||
|
ToolButton {
|
||||||
|
icon.source: '../../icons/paste.png'
|
||||||
|
icon.height: constants.iconSizeMedium
|
||||||
|
icon.width: constants.iconSizeMedium
|
||||||
|
onClicked: {
|
||||||
|
if (channelopener.validate_nodeid(AppController.clipboardToText())) {
|
||||||
|
channelopener.nodeid = AppController.clipboardToText()
|
||||||
|
node.text = channelopener.nodeid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ToolButton {
|
||||||
|
icon.source: '../../icons/qrcode.png'
|
||||||
|
icon.height: constants.iconSizeMedium
|
||||||
|
icon.width: constants.iconSizeMedium
|
||||||
|
scale: 1.2
|
||||||
|
onClicked: {
|
||||||
|
var page = app.stack.push(Qt.resolvedUrl('Scan.qml'))
|
||||||
|
page.onFound.connect(function() {
|
||||||
|
if (channelopener.validate_nodeid(page.scanData)) {
|
||||||
|
channelopener.nodeid = page.scanData
|
||||||
|
node.text = channelopener.nodeid
|
||||||
|
}
|
||||||
|
app.stack.pop()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ToolButton {
|
|
||||||
icon.source: '../../icons/qrcode.png'
|
// trampoline
|
||||||
icon.height: constants.iconSizeMedium
|
ComboBox {
|
||||||
icon.width: constants.iconSizeMedium
|
visible: !Config.useGossip
|
||||||
scale: 1.2
|
Layout.columnSpan: 3
|
||||||
onClicked: {
|
Layout.fillWidth: true
|
||||||
var page = app.stack.push(Qt.resolvedUrl('Scan.qml'))
|
model: channelopener.trampolineNodeNames
|
||||||
page.onFound.connect(function() {
|
onCurrentValueChanged: {
|
||||||
if (channelopener.validate_nodeid(page.scanData)) {
|
if (activeFocus)
|
||||||
channelopener.nodeid = page.scanData
|
channelopener.nodeid = currentValue
|
||||||
node.text = channelopener.nodeid
|
}
|
||||||
}
|
// preselect a random node
|
||||||
app.stack.pop()
|
Component.onCompleted: {
|
||||||
})
|
if (!Config.useGossip) {
|
||||||
|
currentIndex = Math.floor(Math.random() * channelopener.trampolineNodeNames.length)
|
||||||
|
channelopener.nodeid = currentValue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// trampoline
|
|
||||||
ComboBox {
|
|
||||||
visible: !Config.useGossip
|
|
||||||
Layout.columnSpan: 3
|
|
||||||
Layout.fillWidth: true
|
|
||||||
model: channelopener.trampolineNodeNames
|
|
||||||
onCurrentValueChanged: {
|
|
||||||
if (activeFocus)
|
|
||||||
channelopener.nodeid = currentValue
|
|
||||||
}
|
|
||||||
// preselect a random node
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (!Config.useGossip) {
|
|
||||||
currentIndex = Math.floor(Math.random() * channelopener.trampolineNodeNames.length)
|
|
||||||
channelopener.nodeid = currentValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
text: qsTr('Amount')
|
|
||||||
color: Material.accentColor
|
|
||||||
}
|
|
||||||
|
|
||||||
BtcField {
|
|
||||||
id: amount
|
|
||||||
fiatfield: amountFiat
|
|
||||||
Layout.preferredWidth: parent.width /3
|
|
||||||
onTextChanged: channelopener.amount = Config.unitsToSats(amount.text)
|
|
||||||
enabled: !is_max.checked
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Label {
|
Label {
|
||||||
text: Config.baseUnit
|
text: qsTr('Amount')
|
||||||
color: Material.accentColor
|
color: Material.accentColor
|
||||||
}
|
}
|
||||||
Switch {
|
|
||||||
id: is_max
|
BtcField {
|
||||||
text: qsTr('Max')
|
id: amount
|
||||||
onCheckedChanged: {
|
fiatfield: amountFiat
|
||||||
channelopener.amount = checked ? MAX : Config.unitsToSats(amount.text)
|
Layout.preferredWidth: parent.width /3
|
||||||
|
onTextChanged: channelopener.amount = Config.unitsToSats(amount.text)
|
||||||
|
enabled: !is_max.checked
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Label {
|
||||||
|
text: Config.baseUnit
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
|
Switch {
|
||||||
|
id: is_max
|
||||||
|
text: qsTr('Max')
|
||||||
|
onCheckedChanged: {
|
||||||
|
channelopener.amount = checked ? MAX : Config.unitsToSats(amount.text)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Item { width: 1; height: 1; visible: Daemon.fx.enabled }
|
||||||
|
|
||||||
|
FiatField {
|
||||||
|
id: amountFiat
|
||||||
|
btcfield: amount
|
||||||
|
visible: Daemon.fx.enabled
|
||||||
|
Layout.preferredWidth: parent.width /3
|
||||||
|
enabled: !is_max.checked
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: Daemon.fx.enabled
|
||||||
|
text: Daemon.fx.fiatCurrency
|
||||||
|
color: Material.accentColor
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Item { visible: Daemon.fx.enabled ; height: 1; width: 1 }
|
||||||
}
|
}
|
||||||
|
|
||||||
Item { width: 1; height: 1; visible: Daemon.fx.enabled }
|
|
||||||
|
|
||||||
FiatField {
|
|
||||||
id: amountFiat
|
|
||||||
btcfield: amount
|
|
||||||
visible: Daemon.fx.enabled
|
|
||||||
Layout.preferredWidth: parent.width /3
|
|
||||||
enabled: !is_max.checked
|
|
||||||
}
|
|
||||||
|
|
||||||
Label {
|
|
||||||
visible: Daemon.fx.enabled
|
|
||||||
text: Daemon.fx.fiatCurrency
|
|
||||||
color: Material.accentColor
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Item { visible: Daemon.fx.enabled ; height: 1; width: 1 }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
|
|
||||||
|
|
||||||
FlatButton {
|
FlatButton {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: qsTr('Open Channel')
|
text: qsTr('Open Channel')
|
||||||
|
|||||||
Reference in New Issue
Block a user