From 3b25f00041a9bd846dfcd1088b4c338b9e251077 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Mon, 11 Apr 2022 11:25:42 +0200 Subject: [PATCH] update History page delegates when rates or rate settings change --- electrum/gui/icons/confirmed_bw.png | Bin 0 -> 5113 bytes electrum/gui/qml/components/History.qml | 40 ++++++++++++++++++------ 2 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 electrum/gui/icons/confirmed_bw.png diff --git a/electrum/gui/icons/confirmed_bw.png b/electrum/gui/icons/confirmed_bw.png new file mode 100644 index 0000000000000000000000000000000000000000..ba66aa084911d4e7140d88c82e7c003e04dae2b0 GIT binary patch literal 5113 zcmVRNjYv#n>f<@kYaTX9uttG1acEvS@Qmr*I8CSnl~Q9&B{2qENSCYhP{z4t!*$4o-_ z4v+x%LwD2T*}Em z8x}Va%oG7zEQtdE0t_esL_qH!m?`@>GhhiY3>X5mh4c*5HWIYdX#1?M><+IbH(6VI zNty>};l~XC5z&$*OG1w0;BHAl710awFSOf3?_y%MF zp&4Wam;exiNq`jy4lxG+asWtRFEGroL`WG{t(L@dzD+$Q)9KyS)z#h!1t0>5am$ts z6`s6|SVyGLXAn_v?=BK&gypn_OlXKrfLNs@Vl4T6-N8C1NAELncXu}_m9M%4f58>> zRVgtQ){IuLLjZOG1bf*;#B4cbNo}gsAU=m0#nbg5gW#b^uq?*RE1 z1Dr>_G$#unX@Ol9@^uURj+4AL97ejy7(F%|_NuC?^br;4$dQ3?d%GiqQ0-cuCdj!; z8FRfLQ%*!VV3s|{gF$i4qLHM!yC}z5S5;M&8WaGCh@Se>pTc3vnHCWGL1Ht4z)tUu zFp?Iu%~0SM0YfhYgC-FO1ky(mxIa_JVllTRnH<8toG!`UrpTN{gxtMAkY>=%G~|7{ zWax|6U3g)1UwZOXeI%Ulr1Rf4RQs!of`>b9z z!rWOseR}heKsXWr^t;8cl?s7h1>s)`*xVj%Y(YDWRX<9!B^TG$&g@{upbNhLk$hsw zl2DNm;~{8)B6~K01KI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{D2g74Rnm{QK#jO>eS|OHL-(QhJs=Zj1d&y*Fy1E(z b9zFVhpyOgQ7`oGt00000NkvXXu0mjfDMYXo literal 0 HcmV?d00001 diff --git a/electrum/gui/qml/components/History.qml b/electrum/gui/qml/components/History.qml index e14e57848..8f1d05dca 100644 --- a/electrum/gui/qml/components/History.qml +++ b/electrum/gui/qml/components/History.qml @@ -82,7 +82,7 @@ Pane { "../../../gui/icons/clock3.png", "../../../gui/icons/clock4.png", "../../../gui/icons/clock5.png", - "../../../gui/icons/confirmed.png" + "../../../gui/icons/confirmed_bw.png" ] Layout.preferredWidth: constants.iconSizeLarge @@ -106,18 +106,34 @@ Pane { font.family: FixedFont font.pixelSize: constants.fontSizeMedium Layout.alignment: Qt.AlignRight - text: Config.formatSats(model.bc_value) font.bold: true color: model.incoming ? constants.colorCredit : constants.colorDebit + + function updateText() { + text = Config.formatSats(model.bc_value) + } + Component.onCompleted: updateText() } Label { font.pixelSize: constants.fontSizeSmall text: model.date } Label { - font.pixelSize: constants.fontSizeXSmall + id: fiatLabel + font.pixelSize: constants.fontSizeSmall 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 } } @@ -135,12 +151,16 @@ Pane { // hook up events that might change the appearance Connections { target: Config - function onBaseUnitChanged() { - valueLabel.text = Config.formatSats(model.bc_value) - } - function onThousandsSeparatorChanged() { - valueLabel.text = Config.formatSats(model.bc_value) - } + function onBaseUnitChanged() { valueLabel.updateText() } + function onThousandsSeparatorChanged() { valueLabel.updateText() } + } + + Connections { + target: Daemon.fx + function onHistoricRatesChanged() { fiatLabel.updateText() } + function onQuotesUpdated() { fiatLabel.updateText() } + function onHistoryUpdated() { fiatLabel.updateText() } + function onEnabledUpdated() { fiatLabel.updateText() } } Component.onCompleted: {