qml: ui
This commit is contained in:
@@ -24,7 +24,6 @@ Pane {
|
||||
icon.color: 'transparent'
|
||||
action: Action {
|
||||
text: qsTr('Spend from')
|
||||
//onTriggered:
|
||||
icon.source: '../../icons/tab_send.png'
|
||||
enabled: false
|
||||
}
|
||||
@@ -45,6 +44,14 @@ Pane {
|
||||
enabled: false
|
||||
}
|
||||
}
|
||||
MenuItem {
|
||||
icon.color: 'transparent'
|
||||
action: Action {
|
||||
text: addressdetails.isFrozen ? qsTr('Unfreeze') : qsTr('Freeze')
|
||||
onTriggered: addressdetails.freeze(!addressdetails.isFrozen)
|
||||
icon.source: '../../icons/seal.png'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Flickable {
|
||||
@@ -245,15 +252,6 @@ Pane {
|
||||
Label {
|
||||
text: addressdetails.isFrozen ? qsTr('Frozen') : qsTr('Not frozen')
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.columnSpan: 2
|
||||
|
||||
Button {
|
||||
text: addressdetails.isFrozen ? qsTr('Unfreeze') : qsTr('Freeze')
|
||||
onClicked: addressdetails.freeze(!addressdetails.isFrozen)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,9 @@ ElDialog {
|
||||
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
padding: 0
|
||||
|
||||
standardButtons: Dialog.Cancel
|
||||
|
||||
modal: true
|
||||
parent: Overlay.overlay
|
||||
@@ -42,220 +45,201 @@ ElDialog {
|
||||
: ''
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
id: layout
|
||||
ColumnLayout {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
columns: 2
|
||||
spacing: 0
|
||||
|
||||
Rectangle {
|
||||
height: 1
|
||||
Layout.fillWidth: true
|
||||
Layout.columnSpan: 2
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
Label {
|
||||
id: amountLabel
|
||||
text: qsTr('Amount to send')
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Label {
|
||||
id: btcValue
|
||||
font.bold: true
|
||||
}
|
||||
GridLayout {
|
||||
width: parent.width
|
||||
columns: 2
|
||||
Layout.leftMargin: constants.paddingLarge
|
||||
Layout.rightMargin: constants.paddingLarge
|
||||
|
||||
Label {
|
||||
text: Config.baseUnit
|
||||
id: amountLabel
|
||||
text: qsTr('Amount to send')
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
Label {
|
||||
id: fiatValue
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: constants.fontSizeMedium
|
||||
}
|
||||
Label {
|
||||
id: btcValue
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
Component.onCompleted: updateAmountText()
|
||||
Connections {
|
||||
target: finalizer
|
||||
function onEffectiveAmountChanged() {
|
||||
updateAmountText()
|
||||
Label {
|
||||
text: Config.baseUnit
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
Label {
|
||||
id: fiatValue
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: constants.fontSizeMedium
|
||||
}
|
||||
|
||||
Component.onCompleted: updateAmountText()
|
||||
Connections {
|
||||
target: finalizer
|
||||
function onEffectiveAmountChanged() {
|
||||
updateAmountText()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr('Mining fee')
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Label {
|
||||
id: fee
|
||||
text: Config.formatSats(finalizer.fee)
|
||||
}
|
||||
|
||||
Label {
|
||||
text: Config.baseUnit
|
||||
text: qsTr('Mining fee')
|
||||
color: Material.accentColor
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr('Fee rate')
|
||||
}
|
||||
RowLayout {
|
||||
Label {
|
||||
id: fee
|
||||
text: Config.formatSats(finalizer.fee)
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Label {
|
||||
id: feeRate
|
||||
text: finalizer.feeRate
|
||||
}
|
||||
|
||||
Label {
|
||||
text: 'sat/vB'
|
||||
color: Material.accentColor
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr('Target')
|
||||
}
|
||||
|
||||
Label {
|
||||
id: targetdesc
|
||||
text: finalizer.target
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: feeslider
|
||||
snapMode: Slider.SnapOnRelease
|
||||
stepSize: 1
|
||||
from: 0
|
||||
to: finalizer.sliderSteps
|
||||
onValueChanged: {
|
||||
if (activeFocus)
|
||||
finalizer.sliderPos = value
|
||||
}
|
||||
Component.onCompleted: {
|
||||
value = finalizer.sliderPos
|
||||
}
|
||||
Connections {
|
||||
target: finalizer
|
||||
function onSliderPosChanged() {
|
||||
feeslider.value = finalizer.sliderPos
|
||||
Label {
|
||||
text: Config.baseUnit
|
||||
color: Material.accentColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
id: target
|
||||
textRole: 'text'
|
||||
valueRole: 'value'
|
||||
model: [
|
||||
{ text: qsTr('ETA'), value: 1 },
|
||||
{ text: qsTr('Mempool'), value: 2 },
|
||||
{ text: qsTr('Static'), value: 0 }
|
||||
]
|
||||
onCurrentValueChanged: {
|
||||
if (activeFocus)
|
||||
finalizer.method = currentValue
|
||||
Label {
|
||||
text: qsTr('Fee rate')
|
||||
color: Material.accentColor
|
||||
}
|
||||
Component.onCompleted: {
|
||||
currentIndex = indexOfValue(finalizer.method)
|
||||
|
||||
RowLayout {
|
||||
Label {
|
||||
id: feeRate
|
||||
text: finalizer.feeRate
|
||||
}
|
||||
|
||||
Label {
|
||||
text: 'sat/vB'
|
||||
color: Material.accentColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InfoTextArea {
|
||||
Layout.columnSpan: 2
|
||||
visible: finalizer.warning != ''
|
||||
text: finalizer.warning
|
||||
iconStyle: InfoTextArea.IconStyle.Warn
|
||||
}
|
||||
Label {
|
||||
text: qsTr('Target')
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
id: final_cb
|
||||
text: qsTr('Replace-by-Fee')
|
||||
Layout.columnSpan: 2
|
||||
checked: finalizer.rbf
|
||||
visible: finalizer.canRbf
|
||||
}
|
||||
Label {
|
||||
id: targetdesc
|
||||
text: finalizer.target
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
height: 1
|
||||
Layout.fillWidth: true
|
||||
Layout.columnSpan: 2
|
||||
color: Material.accentColor
|
||||
}
|
||||
Slider {
|
||||
id: feeslider
|
||||
leftPadding: constants.paddingMedium
|
||||
snapMode: Slider.SnapOnRelease
|
||||
stepSize: 1
|
||||
from: 0
|
||||
to: finalizer.sliderSteps
|
||||
onValueChanged: {
|
||||
if (activeFocus)
|
||||
finalizer.sliderPos = value
|
||||
}
|
||||
Component.onCompleted: {
|
||||
value = finalizer.sliderPos
|
||||
}
|
||||
Connections {
|
||||
target: finalizer
|
||||
function onSliderPosChanged() {
|
||||
feeslider.value = finalizer.sliderPos
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr('Outputs')
|
||||
Layout.columnSpan: 2
|
||||
}
|
||||
ComboBox {
|
||||
id: target
|
||||
textRole: 'text'
|
||||
valueRole: 'value'
|
||||
model: [
|
||||
{ text: qsTr('ETA'), value: 1 },
|
||||
{ text: qsTr('Mempool'), value: 2 },
|
||||
{ text: qsTr('Static'), value: 0 }
|
||||
]
|
||||
onCurrentValueChanged: {
|
||||
if (activeFocus)
|
||||
finalizer.method = currentValue
|
||||
}
|
||||
Component.onCompleted: {
|
||||
currentIndex = indexOfValue(finalizer.method)
|
||||
}
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: finalizer.outputs
|
||||
delegate: TextHighlightPane {
|
||||
InfoTextArea {
|
||||
Layout.columnSpan: 2
|
||||
Layout.fillWidth: true
|
||||
padding: 0
|
||||
leftPadding: constants.paddingSmall
|
||||
RowLayout {
|
||||
width: parent.width
|
||||
Label {
|
||||
text: modelData.address
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
font.pixelSize: constants.fontSizeLarge
|
||||
font.family: FixedFont
|
||||
color: modelData.is_mine ? constants.colorMine : Material.foreground
|
||||
}
|
||||
Label {
|
||||
text: Config.formatSats(modelData.value_sats)
|
||||
font.pixelSize: constants.fontSizeMedium
|
||||
font.family: FixedFont
|
||||
}
|
||||
Label {
|
||||
text: Config.baseUnit
|
||||
font.pixelSize: constants.fontSizeMedium
|
||||
color: Material.accentColor
|
||||
visible: finalizer.warning != ''
|
||||
text: finalizer.warning
|
||||
iconStyle: InfoTextArea.IconStyle.Warn
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
id: final_cb
|
||||
text: qsTr('Replace-by-Fee')
|
||||
Layout.columnSpan: 2
|
||||
checked: finalizer.rbf
|
||||
visible: finalizer.canRbf
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr('Outputs')
|
||||
Layout.columnSpan: 2
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: finalizer.outputs
|
||||
delegate: TextHighlightPane {
|
||||
Layout.columnSpan: 2
|
||||
Layout.fillWidth: true
|
||||
padding: 0
|
||||
leftPadding: constants.paddingSmall
|
||||
RowLayout {
|
||||
width: parent.width
|
||||
Label {
|
||||
text: modelData.address
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.Wrap
|
||||
font.pixelSize: constants.fontSizeLarge
|
||||
font.family: FixedFont
|
||||
color: modelData.is_mine ? constants.colorMine : Material.foreground
|
||||
}
|
||||
Label {
|
||||
text: Config.formatSats(modelData.value_sats)
|
||||
font.pixelSize: constants.fontSizeMedium
|
||||
font.family: FixedFont
|
||||
}
|
||||
Label {
|
||||
text: Config.baseUnit
|
||||
font.pixelSize: constants.fontSizeMedium
|
||||
color: Material.accentColor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
height: 1
|
||||
Layout.fillWidth: true
|
||||
Layout.columnSpan: 2
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
|
||||
|
||||
RowLayout {
|
||||
Layout.columnSpan: 2
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
Button {
|
||||
text: qsTr('Cancel')
|
||||
onClicked: {
|
||||
txcancelled()
|
||||
dialog.close()
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: sendButton
|
||||
text: Daemon.currentWallet.isWatchOnly ? qsTr('Finalize') : qsTr('Pay')
|
||||
enabled: finalizer.valid
|
||||
onClicked: {
|
||||
txaccepted()
|
||||
dialog.close()
|
||||
}
|
||||
FlatButton {
|
||||
id: sendButton
|
||||
Layout.fillWidth: true
|
||||
text: Daemon.currentWallet.isWatchOnly ? qsTr('Finalize') : qsTr('Pay')
|
||||
icon.source: '../../icons/confirmed.png'
|
||||
enabled: finalizer.valid
|
||||
onClicked: {
|
||||
txaccepted()
|
||||
dialog.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onClosed: txcancelled()
|
||||
}
|
||||
|
||||
@@ -26,20 +26,6 @@ ElDialog {
|
||||
color: "#aa000000"
|
||||
}
|
||||
|
||||
// header: RowLayout {
|
||||
// width: dialog.width
|
||||
// Label {
|
||||
// Layout.fillWidth: true
|
||||
// text: dialog.title
|
||||
// visible: dialog.title
|
||||
// elide: Label.ElideRight
|
||||
// padding: constants.paddingXLarge
|
||||
// bottomPadding: 0
|
||||
// font.bold: true
|
||||
// font.pixelSize: constants.fontSizeMedium
|
||||
// }
|
||||
// }
|
||||
|
||||
Flickable {
|
||||
anchors.fill: parent
|
||||
contentHeight: rootLayout.height
|
||||
@@ -51,12 +37,6 @@ ElDialog {
|
||||
width: parent.width
|
||||
spacing: constants.paddingMedium
|
||||
|
||||
Rectangle {
|
||||
height: 1
|
||||
Layout.fillWidth: true
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
QRImage {
|
||||
id: qr
|
||||
render: dialog.enter ? false : true
|
||||
@@ -66,12 +46,6 @@ ElDialog {
|
||||
Layout.bottomMargin: constants.paddingSmall
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
height: 1
|
||||
Layout.fillWidth: true
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
TextHighlightPane {
|
||||
Layout.fillWidth: true
|
||||
Label {
|
||||
@@ -92,15 +66,23 @@ ElDialog {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
height: 1
|
||||
Layout.preferredWidth: qr.width
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Button {
|
||||
|
||||
FlatButton {
|
||||
text: qsTr('Copy')
|
||||
icon.source: '../../icons/copy_bw.png'
|
||||
onClicked: AppController.textToClipboard(dialog.text)
|
||||
}
|
||||
Button {
|
||||
FlatButton {
|
||||
text: qsTr('Share')
|
||||
icon.source: '../../icons/share.png'
|
||||
onClicked: {
|
||||
|
||||
@@ -18,291 +18,297 @@ ElDialog {
|
||||
title: qsTr('Invoice')
|
||||
standardButtons: invoice_key != '' ? Dialog.Close : Dialog.Cancel
|
||||
|
||||
padding: 0
|
||||
|
||||
modal: true
|
||||
parent: Overlay.overlay
|
||||
Overlay.modal: Rectangle {
|
||||
color: "#aa000000"
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
id: layout
|
||||
ColumnLayout {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
columns: 2
|
||||
spacing: 0
|
||||
|
||||
Label {
|
||||
text: qsTr('Type')
|
||||
color: Material.accentColor
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Image {
|
||||
Layout.preferredWidth: constants.iconSizeSmall
|
||||
Layout.preferredHeight: constants.iconSizeSmall
|
||||
source: invoice.invoiceType == Invoice.LightningInvoice
|
||||
? "../../icons/lightning.png"
|
||||
: "../../icons/bitcoin.png"
|
||||
}
|
||||
GridLayout {
|
||||
id: layout
|
||||
width: parent.width
|
||||
Layout.leftMargin: constants.paddingLarge
|
||||
Layout.rightMargin: constants.paddingLarge
|
||||
columns: 2
|
||||
|
||||
Label {
|
||||
text: invoice.invoiceType == Invoice.OnchainInvoice
|
||||
? qsTr('On chain')
|
||||
: invoice.invoiceType == Invoice.LightningInvoice
|
||||
? qsTr('Lightning')
|
||||
: ''
|
||||
Layout.fillWidth: true
|
||||
text: qsTr('Type')
|
||||
color: Material.accentColor
|
||||
}
|
||||
}
|
||||
|
||||
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: invoice.lnprops ? invoice.lnprops.pubkey : ''
|
||||
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.preferredWidth: parent.width
|
||||
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.preferredWidth: parent.width //* 0.75
|
||||
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 {
|
||||
font.pixelSize: constants.fontSizeXLarge
|
||||
font.family: FixedFont
|
||||
font.bold: true
|
||||
text: Config.formatSats(invoice.amount, false)
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: Config.baseUnit
|
||||
color: Material.accentColor
|
||||
font.pixelSize: constants.fontSizeXLarge
|
||||
}
|
||||
|
||||
Label {
|
||||
id: fiatValue
|
||||
visible: Daemon.fx.enabled
|
||||
text: Daemon.fx.fiatValue(invoice.amount, false)
|
||||
font.pixelSize: constants.fontSizeMedium
|
||||
color: constants.mutedForeground
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: Daemon.fx.enabled
|
||||
Layout.fillWidth: true
|
||||
text: Daemon.fx.fiatCurrency
|
||||
font.pixelSize: constants.fontSizeMedium
|
||||
color: constants.mutedForeground
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
Image {
|
||||
Layout.preferredWidth: constants.iconSizeSmall
|
||||
Layout.preferredHeight: constants.iconSizeSmall
|
||||
source: invoice.invoiceType == Invoice.LightningInvoice
|
||||
? "../../icons/lightning.png"
|
||||
: "../../icons/bitcoin.png"
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
visible: !amountContainer.editmode
|
||||
icon.source: '../../icons/pen.png'
|
||||
icon.color: 'transparent'
|
||||
onClicked: {
|
||||
amountBtc.text = invoice.amount.satsInt == 0 ? '' : Config.formatSats(invoice.amount)
|
||||
amountContainer.editmode = true
|
||||
amountBtc.focus = true
|
||||
}
|
||||
}
|
||||
GridLayout {
|
||||
visible: amountContainer.editmode
|
||||
Label {
|
||||
text: invoice.invoiceType == Invoice.OnchainInvoice
|
||||
? qsTr('On chain')
|
||||
: invoice.invoiceType == Invoice.LightningInvoice
|
||||
? qsTr('Lightning')
|
||||
: ''
|
||||
Layout.fillWidth: true
|
||||
columns: 2
|
||||
BtcField {
|
||||
id: amountBtc
|
||||
fiatfield: amountFiat
|
||||
}
|
||||
}
|
||||
|
||||
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: invoice.lnprops ? invoice.lnprops.pubkey : ''
|
||||
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 {
|
||||
font.pixelSize: constants.fontSizeXLarge
|
||||
font.family: FixedFont
|
||||
font.bold: true
|
||||
text: Config.formatSats(invoice.amount, false)
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
text: Config.baseUnit
|
||||
color: Material.accentColor
|
||||
font.pixelSize: constants.fontSizeXLarge
|
||||
}
|
||||
|
||||
Label {
|
||||
id: fiatValue
|
||||
visible: Daemon.fx.enabled
|
||||
text: Daemon.fx.fiatValue(invoice.amount, false)
|
||||
font.pixelSize: constants.fontSizeMedium
|
||||
color: constants.mutedForeground
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: Daemon.fx.enabled
|
||||
Layout.fillWidth: true
|
||||
text: Daemon.fx.fiatCurrency
|
||||
font.pixelSize: constants.fontSizeMedium
|
||||
color: constants.mutedForeground
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Label {
|
||||
text: Config.baseUnit
|
||||
color: Material.accentColor
|
||||
ToolButton {
|
||||
visible: !amountContainer.editmode
|
||||
icon.source: '../../icons/pen.png'
|
||||
icon.color: 'transparent'
|
||||
onClicked: {
|
||||
amountBtc.text = invoice.amount.satsInt == 0 ? '' : Config.formatSats(invoice.amount)
|
||||
amountContainer.editmode = true
|
||||
amountBtc.focus = true
|
||||
}
|
||||
}
|
||||
GridLayout {
|
||||
visible: amountContainer.editmode
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
columns: 2
|
||||
BtcField {
|
||||
id: amountBtc
|
||||
fiatfield: amountFiat
|
||||
}
|
||||
|
||||
FiatField {
|
||||
id: amountFiat
|
||||
btcfield: amountBtc
|
||||
visible: Daemon.fx.enabled
|
||||
}
|
||||
Label {
|
||||
text: Config.baseUnit
|
||||
color: Material.accentColor
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: Daemon.fx.enabled
|
||||
text: Daemon.fx.fiatCurrency
|
||||
color: Material.accentColor
|
||||
FiatField {
|
||||
id: amountFiat
|
||||
btcfield: amountBtc
|
||||
visible: Daemon.fx.enabled
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: Daemon.fx.enabled
|
||||
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 = Config.unitsToSats(amountBtc.text)
|
||||
}
|
||||
}
|
||||
ToolButton {
|
||||
visible: amountContainer.editmode
|
||||
Layout.fillWidth: false
|
||||
icon.source: '../../icons/closebutton.png'
|
||||
icon.color: 'transparent'
|
||||
onClicked: amountContainer.editmode = false
|
||||
}
|
||||
}
|
||||
ToolButton {
|
||||
visible: amountContainer.editmode
|
||||
Layout.fillWidth: false
|
||||
icon.source: '../../icons/confirmed.png'
|
||||
icon.color: 'transparent'
|
||||
onClicked: {
|
||||
amountContainer.editmode = false
|
||||
invoice.amount = Config.unitsToSats(amountBtc.text)
|
||||
}
|
||||
}
|
||||
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 }
|
||||
|
||||
Item { Layout.preferredHeight: constants.paddingLarge; Layout.preferredWidth: 1 }
|
||||
|
||||
InfoTextArea {
|
||||
Layout.columnSpan: 2
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
visible: invoice.userinfo
|
||||
text: invoice.userinfo
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.columnSpan: 2
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
spacing: constants.paddingMedium
|
||||
|
||||
FlatButton {
|
||||
text: qsTr('Delete')
|
||||
icon.source: '../../icons/delete.png'
|
||||
visible: invoice_key != ''
|
||||
onClicked: {
|
||||
invoice.wallet.delete_invoice(invoice_key)
|
||||
dialog.close()
|
||||
}
|
||||
}
|
||||
|
||||
FlatButton {
|
||||
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 {
|
||||
text: qsTr('Pay')
|
||||
icon.source: '../../icons/confirmed.png'
|
||||
enabled: invoice.invoiceType != Invoice.Invalid && invoice.canPay
|
||||
onClicked: {
|
||||
if (invoice_key == '') // save invoice if not retrieved from key
|
||||
invoice.save_invoice()
|
||||
dialog.close()
|
||||
doPay() // only signal here
|
||||
}
|
||||
InfoTextArea {
|
||||
Layout.columnSpan: 2
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
visible: invoice.userinfo
|
||||
text: invoice.userinfo
|
||||
}
|
||||
}
|
||||
|
||||
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
|
||||
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr('Pay')
|
||||
icon.source: '../../icons/confirmed.png'
|
||||
enabled: invoice.invoiceType != Invoice.Invalid && invoice.canPay
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
|
||||
@@ -19,19 +19,23 @@ ElDialog {
|
||||
|
||||
parent: Overlay.overlay
|
||||
modal: true
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
standardButtons: Dialog.Cancel
|
||||
anchors.centerIn: parent
|
||||
padding: 0
|
||||
|
||||
Overlay.modal: Rectangle {
|
||||
color: "#aa000000"
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
width: parent.width
|
||||
spacing: 0
|
||||
|
||||
InfoTextArea {
|
||||
visible: infotext
|
||||
text: infotext
|
||||
Layout.preferredWidth: password_layout.width
|
||||
Layout.margins: constants.paddingMedium
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
@@ -59,25 +63,15 @@ ElDialog {
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: constants.paddingXXLarge
|
||||
|
||||
Button {
|
||||
text: qsTr("Ok")
|
||||
enabled: confirmPassword ? pw_1.text == pw_2.text : true
|
||||
onClicked: {
|
||||
password = pw_1.text
|
||||
passworddialog.accept()
|
||||
}
|
||||
}
|
||||
Button {
|
||||
text: qsTr("Cancel")
|
||||
onClicked: {
|
||||
passworddialog.reject()
|
||||
}
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
text: qsTr("Ok")
|
||||
icon.source: '../../icons/confirmed.png'
|
||||
enabled: confirmPassword ? pw_1.text == pw_2.text : true
|
||||
onClicked: {
|
||||
password = pw_1.text
|
||||
passworddialog.accept()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,9 @@ ElDialog {
|
||||
color: "#aa000000"
|
||||
}
|
||||
|
||||
header: Item {}
|
||||
padding: 0
|
||||
topPadding: 0
|
||||
|
||||
function restart() {
|
||||
qrscan.restart()
|
||||
@@ -28,6 +30,7 @@ ElDialog {
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
|
||||
QRScan {
|
||||
id: qrscan
|
||||
|
||||
@@ -3,9 +3,7 @@ import QtQuick.Layouts 1.0
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Controls.Material 2.0
|
||||
|
||||
GridLayout {
|
||||
property alias text: infotext.text
|
||||
|
||||
Item {
|
||||
enum IconStyle {
|
||||
None,
|
||||
Info,
|
||||
@@ -13,47 +11,54 @@ GridLayout {
|
||||
Error
|
||||
}
|
||||
|
||||
property alias text: infotext.text
|
||||
property int iconStyle: InfoTextArea.IconStyle.Info
|
||||
property alias textFormat: infotext.textFormat
|
||||
|
||||
columns: 1
|
||||
rowSpacing: 0
|
||||
implicitHeight: layout.height
|
||||
|
||||
Rectangle {
|
||||
height: 2
|
||||
Layout.fillWidth: true
|
||||
color: Qt.rgba(1,1,1,0.25)
|
||||
}
|
||||
ColumnLayout {
|
||||
id: layout
|
||||
|
||||
TextArea {
|
||||
id: infotext
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumHeight: constants.iconSizeLarge + 2*constants.paddingLarge
|
||||
readOnly: true
|
||||
rightPadding: constants.paddingLarge
|
||||
leftPadding: 2*constants.iconSizeLarge
|
||||
wrapMode: TextInput.Wrap
|
||||
textFormat: TextEdit.RichText
|
||||
background: Rectangle {
|
||||
color: Qt.rgba(1,1,1,0.05) // whiten 5%
|
||||
spacing: 0
|
||||
width: parent.width
|
||||
|
||||
Rectangle {
|
||||
height: 2
|
||||
Layout.fillWidth: true
|
||||
color: Qt.rgba(1,1,1,0.25)
|
||||
}
|
||||
|
||||
Image {
|
||||
source: iconStyle == InfoTextArea.IconStyle.Info ? "../../../icons/info.png" : iconStyle == InfoTextArea.IconStyle.Warn ? "../../../icons/warning.png" : iconStyle == InfoTextArea.IconStyle.Error ? "../../../icons/expired.png" : ""
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.leftMargin: constants.paddingLarge
|
||||
anchors.topMargin: constants.paddingLarge
|
||||
height: constants.iconSizeLarge
|
||||
width: constants.iconSizeLarge
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
TextArea {
|
||||
id: infotext
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumHeight: constants.iconSizeLarge + 2*constants.paddingLarge
|
||||
readOnly: true
|
||||
rightPadding: constants.paddingLarge
|
||||
leftPadding: 2*constants.iconSizeLarge
|
||||
wrapMode: TextInput.Wrap
|
||||
textFormat: TextEdit.RichText
|
||||
background: Rectangle {
|
||||
color: Qt.rgba(1,1,1,0.05) // whiten 5%
|
||||
}
|
||||
|
||||
Image {
|
||||
source: iconStyle == InfoTextArea.IconStyle.Info ? "../../../icons/info.png" : iconStyle == InfoTextArea.IconStyle.Warn ? "../../../icons/warning.png" : iconStyle == InfoTextArea.IconStyle.Error ? "../../../icons/expired.png" : ""
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.leftMargin: constants.paddingLarge
|
||||
anchors.topMargin: constants.paddingLarge
|
||||
height: constants.iconSizeLarge
|
||||
width: constants.iconSizeLarge
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
height: 2
|
||||
Layout.fillWidth: true
|
||||
color: Qt.rgba(0,0,0,0.25)
|
||||
Rectangle {
|
||||
height: 2
|
||||
Layout.fillWidth: true
|
||||
color: Qt.rgba(0,0,0,0.25)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user