update History page delegates when rates or rate settings change
This commit is contained in:
BIN
electrum/gui/icons/confirmed_bw.png
Normal file
BIN
electrum/gui/icons/confirmed_bw.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
@@ -82,7 +82,7 @@ Pane {
|
|||||||
"../../../gui/icons/clock3.png",
|
"../../../gui/icons/clock3.png",
|
||||||
"../../../gui/icons/clock4.png",
|
"../../../gui/icons/clock4.png",
|
||||||
"../../../gui/icons/clock5.png",
|
"../../../gui/icons/clock5.png",
|
||||||
"../../../gui/icons/confirmed.png"
|
"../../../gui/icons/confirmed_bw.png"
|
||||||
]
|
]
|
||||||
|
|
||||||
Layout.preferredWidth: constants.iconSizeLarge
|
Layout.preferredWidth: constants.iconSizeLarge
|
||||||
@@ -106,18 +106,34 @@ Pane {
|
|||||||
font.family: FixedFont
|
font.family: FixedFont
|
||||||
font.pixelSize: constants.fontSizeMedium
|
font.pixelSize: constants.fontSizeMedium
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
text: Config.formatSats(model.bc_value)
|
|
||||||
font.bold: true
|
font.bold: true
|
||||||
color: model.incoming ? constants.colorCredit : constants.colorDebit
|
color: model.incoming ? constants.colorCredit : constants.colorDebit
|
||||||
|
|
||||||
|
function updateText() {
|
||||||
|
text = Config.formatSats(model.bc_value)
|
||||||
|
}
|
||||||
|
Component.onCompleted: updateText()
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
font.pixelSize: constants.fontSizeSmall
|
font.pixelSize: constants.fontSizeSmall
|
||||||
text: model.date
|
text: model.date
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
font.pixelSize: constants.fontSizeXSmall
|
id: fiatLabel
|
||||||
|
font.pixelSize: constants.fontSizeSmall
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
text: model.fee !== undefined ? 'fee: ' + model.fee : ''
|
color: constants.mutedForeground
|
||||||
|
|
||||||
|
function updateText() {
|
||||||
|
if (!Daemon.fx.enabled) {
|
||||||
|
text = ''
|
||||||
|
} else if (Daemon.fx.historicRates) {
|
||||||
|
text = Daemon.fx.fiatValueHistoric(model.bc_value, model.timestamp) + ' ' + Daemon.fx.fiatCurrency
|
||||||
|
} else {
|
||||||
|
text = Daemon.fx.fiatValue(model.bc_value, false) + ' ' + Daemon.fx.fiatCurrency
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Component.onCompleted: updateText()
|
||||||
}
|
}
|
||||||
Item { Layout.columnSpan: 3; Layout.preferredWidth: 1; Layout.preferredHeight: 1 }
|
Item { Layout.columnSpan: 3; Layout.preferredWidth: 1; Layout.preferredHeight: 1 }
|
||||||
}
|
}
|
||||||
@@ -135,12 +151,16 @@ Pane {
|
|||||||
// hook up events that might change the appearance
|
// hook up events that might change the appearance
|
||||||
Connections {
|
Connections {
|
||||||
target: Config
|
target: Config
|
||||||
function onBaseUnitChanged() {
|
function onBaseUnitChanged() { valueLabel.updateText() }
|
||||||
valueLabel.text = Config.formatSats(model.bc_value)
|
function onThousandsSeparatorChanged() { valueLabel.updateText() }
|
||||||
}
|
}
|
||||||
function onThousandsSeparatorChanged() {
|
|
||||||
valueLabel.text = Config.formatSats(model.bc_value)
|
Connections {
|
||||||
}
|
target: Daemon.fx
|
||||||
|
function onHistoricRatesChanged() { fiatLabel.updateText() }
|
||||||
|
function onQuotesUpdated() { fiatLabel.updateText() }
|
||||||
|
function onHistoryUpdated() { fiatLabel.updateText() }
|
||||||
|
function onEnabledUpdated() { fiatLabel.updateText() }
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|||||||
Reference in New Issue
Block a user