1
0

qml: implement RbF bump methods Decrease payment/Preserve payment

extend FormattedAmount to wrap alt to next line, or show as empty when invalid
This commit is contained in:
Sander van Grieken
2023-01-16 13:15:24 +01:00
parent 393554c31e
commit a986e61047
4 changed files with 108 additions and 56 deletions

View File

@@ -5,20 +5,38 @@ import QtQuick.Controls.Material 2.0
import org.electrum 1.0
RowLayout {
GridLayout {
required property Amount amount
property bool showAlt: true
property bool singleLine: true
property bool valid: true
columns: !valid
? 1
: singleLine
? 3
: 2
Item {
visible: !valid // empty placeholder if not valid
Layout.preferredWidth: 1
Layout.preferredHeight: 1
}
Label {
visible: valid
text: amount.msatsInt > 0 ? Config.formatMilliSats(amount) : Config.formatSats(amount)
font.family: FixedFont
}
Label {
visible: valid
text: Config.baseUnit
color: Material.accentColor
}
Label {
visible: showAlt && Daemon.fx.enabled
Layout.columnSpan: singleLine ? 1 : 2
visible: showAlt && Daemon.fx.enabled && valid
text: '(' + Daemon.fx.fiatValue(amount) + ' ' + Daemon.fx.fiatCurrency + ')'
font.pixelSize: constants.fontSizeSmall
}
}