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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user