qml: styling LnurlPayRequestDialog
This commit is contained in:
@@ -21,20 +21,24 @@ ElDialog {
|
|||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
|
id: rootLayout
|
||||||
columns: 2
|
columns: 2
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: constants.paddingLarge
|
Layout.leftMargin: constants.paddingLarge
|
||||||
Layout.rightMargin: constants.paddingLarge
|
Layout.rightMargin: constants.paddingLarge
|
||||||
|
Layout.bottomMargin: constants.paddingLarge
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr('Provider')
|
text: qsTr('Provider')
|
||||||
color: Material.accentColor
|
color: Material.accentColor
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
|
Layout.fillWidth: true
|
||||||
text: invoiceParser.lnurlData['domain']
|
text: invoiceParser.lnurlData['domain']
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
@@ -42,8 +46,8 @@ ElDialog {
|
|||||||
color: Material.accentColor
|
color: Material.accentColor
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
text: invoiceParser.lnurlData['metadata_plaintext']
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
text: invoiceParser.lnurlData['metadata_plaintext']
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,36 +56,69 @@ ElDialog {
|
|||||||
color: Material.accentColor
|
color: Material.accentColor
|
||||||
}
|
}
|
||||||
|
|
||||||
BtcField {
|
RowLayout {
|
||||||
id: amountBtc
|
Layout.fillWidth: true
|
||||||
text: Config.formatSats(invoiceParser.lnurlData['min_sendable_sat'])
|
BtcField {
|
||||||
enabled: invoiceParser.lnurlData['min_sendable_sat'] != invoiceParser.lnurlData['max_sendable_sat']
|
id: amountBtc
|
||||||
color: Material.foreground // override gray-out on disabled
|
Layout.preferredWidth: rootLayout.width /3
|
||||||
fiatfield: null
|
text: Config.formatSats(invoiceParser.lnurlData['min_sendable_sat'])
|
||||||
Layout.preferredWidth: parent.width /3
|
enabled: invoiceParser.lnurlData['min_sendable_sat'] != invoiceParser.lnurlData['max_sendable_sat']
|
||||||
onTextAsSatsChanged: {
|
color: Material.foreground // override gray-out on disabled
|
||||||
invoiceParser.amountOverride = textAsSats
|
fiatfield: amountFiat
|
||||||
|
onTextAsSatsChanged: {
|
||||||
|
invoiceParser.amountOverride = textAsSats
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
text: Config.baseUnit
|
||||||
|
color: Material.accentColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Label {
|
|
||||||
Layout.columnSpan: 2
|
Item { visible: Daemon.fx.enabled; Layout.preferredWidth: 1; Layout.preferredHeight: 1 }
|
||||||
text: invoiceParser.lnurlData['min_sendable_sat'] == invoiceParser.lnurlData['max_sendable_sat']
|
|
||||||
? ''
|
RowLayout {
|
||||||
: qsTr('Amount must be between %1 and %2').arg(Config.formatSats(invoiceParser.lnurlData['min_sendable_sat'])).arg(Config.formatSats(invoiceParser.lnurlData['max_sendable_sat'])) + Config.baseUnit
|
visible: Daemon.fx.enabled
|
||||||
|
FiatField {
|
||||||
|
id: amountFiat
|
||||||
|
Layout.preferredWidth: rootLayout.width / 3
|
||||||
|
btcfield: amountBtc
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
text: Daemon.fx.fiatCurrency
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InfoTextArea {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
compact: true
|
||||||
|
visible: invoiceParser.lnurlData['min_sendable_sat'] != invoiceParser.lnurlData['max_sendable_sat']
|
||||||
|
text: qsTr('Amount must be between %1 and %2 %3').arg(Config.formatSats(invoiceParser.lnurlData['min_sendable_sat'])).arg(Config.formatSats(invoiceParser.lnurlData['max_sendable_sat'])).arg(Config.baseUnit)
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
visible: invoiceParser.lnurlData['comment_allowed'] > 0
|
||||||
|
text: qsTr('Message')
|
||||||
|
color: Material.accentColor
|
||||||
|
}
|
||||||
TextArea {
|
TextArea {
|
||||||
id: comment
|
id: comment
|
||||||
visible: invoiceParser.lnurlData['comment_allowed'] > 0
|
|
||||||
Layout.columnSpan: 2
|
Layout.columnSpan: 2
|
||||||
Layout.preferredWidth: parent.width
|
Layout.fillWidth: true
|
||||||
|
Layout.leftMargin: constants.paddingLarge
|
||||||
Layout.minimumHeight: 80
|
Layout.minimumHeight: 80
|
||||||
|
visible: invoiceParser.lnurlData['comment_allowed'] > 0
|
||||||
wrapMode: TextEdit.Wrap
|
wrapMode: TextEdit.Wrap
|
||||||
placeholderText: qsTr('Enter an (optional) message for the receiver')
|
placeholderText: qsTr('Enter an (optional) message for the receiver')
|
||||||
color: text.length > invoiceParser.lnurlData['comment_allowed'] ? constants.colorError : Material.foreground
|
color: text.length > invoiceParser.lnurlData['comment_allowed'] ? constants.colorError : Material.foreground
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
Layout.leftMargin: constants.paddingLarge
|
||||||
visible: invoiceParser.lnurlData['comment_allowed'] > 0
|
visible: invoiceParser.lnurlData['comment_allowed'] > 0
|
||||||
text: qsTr('%1 characters remaining').arg(Math.max(0, (invoiceParser.lnurlData['comment_allowed'] - comment.text.length) ))
|
text: qsTr('%1 characters remaining').arg(Math.max(0, (invoiceParser.lnurlData['comment_allowed'] - comment.text.length) ))
|
||||||
color: constants.mutedForeground
|
color: constants.mutedForeground
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ TextHighlightPane {
|
|||||||
property alias text: infotext.text
|
property alias text: infotext.text
|
||||||
property int iconStyle: InfoTextArea.IconStyle.Info
|
property int iconStyle: InfoTextArea.IconStyle.Info
|
||||||
property alias textFormat: infotext.textFormat
|
property alias textFormat: infotext.textFormat
|
||||||
|
property bool compact: false
|
||||||
|
|
||||||
borderColor: iconStyle == InfoTextArea.IconStyle.Info
|
borderColor: iconStyle == InfoTextArea.IconStyle.Info
|
||||||
? constants.colorInfo
|
? constants.colorInfo
|
||||||
@@ -30,15 +31,15 @@ TextHighlightPane {
|
|||||||
: iconStyle == InfoTextArea.IconStyle.Done
|
: iconStyle == InfoTextArea.IconStyle.Done
|
||||||
? constants.colorDone
|
? constants.colorDone
|
||||||
: constants.colorInfo
|
: constants.colorInfo
|
||||||
padding: constants.paddingXLarge
|
padding: compact ? constants.paddingMedium : constants.paddingXLarge
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: constants.paddingLarge
|
spacing: compact ? constants.paddingMedium : constants.paddingLarge
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
Layout.preferredWidth: constants.iconSizeMedium
|
Layout.preferredWidth: compact ? constants.iconSizeSmall : constants.iconSizeMedium
|
||||||
Layout.preferredHeight: constants.iconSizeMedium
|
Layout.preferredHeight: compact ? constants.iconSizeSmall : constants.iconSizeMedium
|
||||||
visible: iconStyle != InfoTextArea.IconStyle.Spinner && iconStyle != InfoTextArea.IconStyle.None
|
visible: iconStyle != InfoTextArea.IconStyle.Spinner && iconStyle != InfoTextArea.IconStyle.None
|
||||||
source: iconStyle == InfoTextArea.IconStyle.Info
|
source: iconStyle == InfoTextArea.IconStyle.Info
|
||||||
? "../../../icons/info.png"
|
? "../../../icons/info.png"
|
||||||
@@ -56,8 +57,8 @@ TextHighlightPane {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.preferredWidth: constants.iconSizeMedium
|
Layout.preferredWidth: compact ? constants.iconSizeSmall : constants.iconSizeMedium
|
||||||
Layout.preferredHeight: constants.iconSizeMedium
|
Layout.preferredHeight: compact ? constants.iconSizeSmall : constants.iconSizeMedium
|
||||||
visible: iconStyle == InfoTextArea.IconStyle.Spinner
|
visible: iconStyle == InfoTextArea.IconStyle.Spinner
|
||||||
|
|
||||||
BusyIndicator {
|
BusyIndicator {
|
||||||
|
|||||||
Reference in New Issue
Block a user