From 8008980f5f8c0caee9818c7624de54defad28302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kyle=20=F0=9F=90=86?= Date: Fri, 17 Oct 2025 19:56:53 -0400 Subject: [PATCH 1/8] feat: add hide amounts config and event --- .../sparrow/event/HideAmountsStatusEvent.java | 13 +++++++++++++ .../java/com/sparrowwallet/sparrow/io/Config.java | 10 ++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/main/java/com/sparrowwallet/sparrow/event/HideAmountsStatusEvent.java diff --git a/src/main/java/com/sparrowwallet/sparrow/event/HideAmountsStatusEvent.java b/src/main/java/com/sparrowwallet/sparrow/event/HideAmountsStatusEvent.java new file mode 100644 index 00000000..43994405 --- /dev/null +++ b/src/main/java/com/sparrowwallet/sparrow/event/HideAmountsStatusEvent.java @@ -0,0 +1,13 @@ +package com.sparrowwallet.sparrow.event; + +public class HideAmountsStatusEvent { + private final boolean hideAmounts; + + public HideAmountsStatusEvent(boolean hideAmounts) { + this.hideAmounts = hideAmounts; + } + + public boolean isHideAmounts() { + return hideAmounts; + } +} diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Config.java b/src/main/java/com/sparrowwallet/sparrow/io/Config.java index 9d4f76ec..06843efb 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Config.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Config.java @@ -47,6 +47,7 @@ public class Config { private Theme theme; private boolean openWalletsInNewWindows = false; private boolean hideEmptyUsedAddresses = false; + private boolean hideAmounts = false; private boolean showTransactionHex = true; private boolean showLoadingLog = true; private boolean showAddressTransactionCount = false; @@ -303,6 +304,15 @@ public class Config { flush(); } + public boolean isHideAmounts() { + return hideAmounts; + } + + public void setHideAmounts(boolean hideAmounts) { + this.hideAmounts = hideAmounts; + flush(); + } + public boolean isShowTransactionHex() { return showTransactionHex; } From 8b1fc0149c12afc492475edfc2997b2876ec44a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kyle=20=F0=9F=90=86?= Date: Fri, 17 Oct 2025 19:57:10 -0400 Subject: [PATCH 2/8] feat: implement hide amounts in coin and fiat controls --- .../sparrow/control/CoinAxisFormatter.java | 4 ++ .../sparrow/control/CoinCell.java | 40 +++++++++++-------- .../sparrow/control/CoinLabel.java | 7 ++++ .../sparrow/control/CopyableCoinLabel.java | 7 ++++ .../sparrow/control/FiatCell.java | 30 +++++++++----- .../sparrow/control/FiatLabel.java | 6 +++ .../sparrow/control/UtxosChart.java | 4 ++ 7 files changed, 70 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/CoinAxisFormatter.java b/src/main/java/com/sparrowwallet/sparrow/control/CoinAxisFormatter.java index 1f3f8f25..a1109842 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/CoinAxisFormatter.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/CoinAxisFormatter.java @@ -2,6 +2,7 @@ package com.sparrowwallet.sparrow.control; import com.sparrowwallet.drongo.BitcoinUnit; import com.sparrowwallet.sparrow.UnitFormat; +import com.sparrowwallet.sparrow.io.Config; import javafx.scene.chart.NumberAxis; import javafx.util.StringConverter; @@ -18,6 +19,9 @@ final class CoinAxisFormatter extends StringConverter { @Override public String toString(Number object) { + if(Config.get().isHideAmounts()) { + return ""; + } Double value = bitcoinUnit.getValue(object.longValue()); return new CoinTextFormatter(unitFormat).getCoinFormat().format(value); } diff --git a/src/main/java/com/sparrowwallet/sparrow/control/CoinCell.java b/src/main/java/com/sparrowwallet/sparrow/control/CoinCell.java index 12375a57..285fed4e 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/CoinCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/CoinCell.java @@ -50,24 +50,30 @@ class CoinCell extends TreeTableCell implements ConfirmationsList Entry entry = getTreeTableView().getTreeItem(getIndex()).getValue(); EntryCell.applyRowStyles(this, entry); - CoinTreeTable coinTreeTable = (CoinTreeTable)getTreeTableView(); - UnitFormat format = coinTreeTable.getUnitFormat(); - BitcoinUnit unit = coinTreeTable.getBitcoinUnit(); - - String satsValue = format.formatSatsValue(amount.longValue()); - DecimalFormat decimalFormat = (amount.longValue() == 0L ? format.getBtcFormat() : format.getTableBtcFormat()); - final String btcValue = decimalFormat.format(amount.doubleValue() / Transaction.SATOSHIS_PER_BITCOIN); - - if(unit.equals(BitcoinUnit.BTC)) { - tooltip.setValue(satsValue + " " + BitcoinUnit.SATOSHIS.getLabel()); - setText(btcValue); + if(Config.get().isHideAmounts()) { + setText("*****"); + setTooltip(null); + setContextMenu(null); } else { - tooltip.setValue(btcValue + " " + BitcoinUnit.BTC.getLabel()); - setText(satsValue); + CoinTreeTable coinTreeTable = (CoinTreeTable)getTreeTableView(); + UnitFormat format = coinTreeTable.getUnitFormat(); + BitcoinUnit unit = coinTreeTable.getBitcoinUnit(); + + String satsValue = format.formatSatsValue(amount.longValue()); + DecimalFormat decimalFormat = (amount.longValue() == 0L ? format.getBtcFormat() : format.getTableBtcFormat()); + final String btcValue = decimalFormat.format(amount.doubleValue() / Transaction.SATOSHIS_PER_BITCOIN); + + if(unit.equals(BitcoinUnit.BTC)) { + tooltip.setValue(satsValue + " " + BitcoinUnit.SATOSHIS.getLabel()); + setText(btcValue); + } else { + tooltip.setValue(btcValue + " " + BitcoinUnit.BTC.getLabel()); + setText(satsValue); + } + setTooltip(tooltip); + contextMenu.updateAmount(amount); + setContextMenu(contextMenu); } - setTooltip(tooltip); - contextMenu.updateAmount(amount); - setContextMenu(contextMenu); if(entry instanceof TransactionEntry transactionEntry) { tooltip.showConfirmations(transactionEntry.confirmationsProperty(), transactionEntry.isCoinbase()); @@ -95,7 +101,7 @@ class CoinCell extends TreeTableCell implements ConfirmationsList setContentDisplay(ContentDisplay.RIGHT); if(((HashIndexEntry) entry).getType() == HashIndexEntry.Type.INPUT) { - satsValue = "-" + satsValue; + setText("-" + getText()); } } else { setGraphic(null); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/CoinLabel.java b/src/main/java/com/sparrowwallet/sparrow/control/CoinLabel.java index 31130465..d7944f35 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/CoinLabel.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/CoinLabel.java @@ -49,6 +49,13 @@ public class CoinLabel extends Label { } private void setValueAsText(Long value, BitcoinUnit bitcoinUnit) { + if(Config.get().isHideAmounts()) { + setText("*****"); + setTooltip(null); + setContextMenu(null); + return; + } + setTooltip(tooltip); setContextMenu(contextMenu); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/CopyableCoinLabel.java b/src/main/java/com/sparrowwallet/sparrow/control/CopyableCoinLabel.java index 1a6a6021..aa357107 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/CopyableCoinLabel.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/CopyableCoinLabel.java @@ -72,6 +72,13 @@ public class CopyableCoinLabel extends CopyableLabel { } private void setValueAsText(Long value, UnitFormat unitFormat, BitcoinUnit bitcoinUnit) { + if(Config.get().isHideAmounts()) { + setText("*****"); + setTooltip(null); + setContextMenu(null); + return; + } + setTooltip(tooltip); setContextMenu(contextMenu); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/FiatCell.java b/src/main/java/com/sparrowwallet/sparrow/control/FiatCell.java index 6036bfa0..fd1b2acf 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/FiatCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/FiatCell.java @@ -4,6 +4,7 @@ import com.sparrowwallet.drongo.OsType; import com.sparrowwallet.drongo.protocol.Transaction; import com.sparrowwallet.sparrow.CurrencyRate; import com.sparrowwallet.sparrow.UnitFormat; +import com.sparrowwallet.sparrow.io.Config; import com.sparrowwallet.sparrow.wallet.Entry; import javafx.scene.control.ContextMenu; import javafx.scene.control.MenuItem; @@ -47,20 +48,27 @@ public class FiatCell extends TreeTableCell { CurrencyRate currencyRate = coinTreeTable.getCurrencyRate(); if(currencyRate != null && currencyRate.isAvailable()) { - Currency currency = currencyRate.getCurrency(); - double btcRate = currencyRate.getBtcRate(); + if(Config.get().isHideAmounts()) { + setText("*****"); + setGraphic(null); + setTooltip(null); + setContextMenu(null); + } else { + Currency currency = currencyRate.getCurrency(); + double btcRate = currencyRate.getBtcRate(); - BigDecimal satsBalance = BigDecimal.valueOf(amount.longValue()); - BigDecimal btcBalance = satsBalance.divide(BigDecimal.valueOf(Transaction.SATOSHIS_PER_BITCOIN)); - BigDecimal fiatBalance = btcBalance.multiply(BigDecimal.valueOf(btcRate)); + BigDecimal satsBalance = BigDecimal.valueOf(amount.longValue()); + BigDecimal btcBalance = satsBalance.divide(BigDecimal.valueOf(Transaction.SATOSHIS_PER_BITCOIN)); + BigDecimal fiatBalance = btcBalance.multiply(BigDecimal.valueOf(btcRate)); - String label = format.formatCurrencyValue(fiatBalance.doubleValue()); - tooltip.setText("1 BTC = " + currency.getSymbol() + " " + format.formatCurrencyValue(btcRate)); + String label = format.formatCurrencyValue(fiatBalance.doubleValue()); + tooltip.setText("1 BTC = " + currency.getSymbol() + " " + format.formatCurrencyValue(btcRate)); - setText(label); - setGraphic(null); - setTooltip(tooltip); - setContextMenu(contextMenu); + setText(label); + setGraphic(null); + setTooltip(tooltip); + setContextMenu(contextMenu); + } } else { setText(null); setGraphic(null); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/FiatLabel.java b/src/main/java/com/sparrowwallet/sparrow/control/FiatLabel.java index e17635ac..5d2e1f54 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/FiatLabel.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/FiatLabel.java @@ -90,6 +90,12 @@ public class FiatLabel extends CopyableLabel { private void setValueAsText(long balance, UnitFormat unitFormat) { if(getCurrency() != null && getBtcRate() > 0.0) { + if(Config.get().isHideAmounts()) { + setText("*****"); + setTooltip(null); + setContextMenu(null); + return; + } BigDecimal satsBalance = BigDecimal.valueOf(balance); BigDecimal btcBalance = satsBalance.divide(BigDecimal.valueOf(Transaction.SATOSHIS_PER_BITCOIN)); BigDecimal fiatBalance = btcBalance.multiply(BigDecimal.valueOf(getBtcRate())); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/UtxosChart.java b/src/main/java/com/sparrowwallet/sparrow/control/UtxosChart.java index 1e4bfe20..4f579d1f 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/UtxosChart.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/UtxosChart.java @@ -90,6 +90,10 @@ public class UtxosChart extends BarChart { private void installTooltip(XYChart.Data item) { Tooltip.uninstall(item.getNode(), null); + if(Config.get().isHideAmounts()) { + return; + } + String satsValue = String.format(Locale.ENGLISH, "%,d", item.getYValue()); Tooltip tooltip = new Tooltip(item.getXValue() + "\n" + satsValue + " sats"); tooltip.setShowDelay(Duration.millis(TOOLTIP_SHOW_DELAY)); From 73da024645913aa9139afe40497dc69c44735034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kyle=20=F0=9F=90=86?= Date: Fri, 17 Oct 2025 19:57:22 -0400 Subject: [PATCH 3/8] feat: add eye toggle button in status bar --- .../sparrowwallet/sparrow/AppController.java | 33 +++++++++++++++++++ .../sparrow/glyphfont/FontAwesome5.java | 1 + .../com/sparrowwallet/sparrow/app.fxml | 6 ++++ 3 files changed, 40 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 7cbe4777..c068eb1c 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -149,6 +149,12 @@ public class AppController implements Initializable { private CheckMenuItem hideEmptyUsedAddresses; private static final BooleanProperty hideEmptyUsedAddressesProperty = new SimpleBooleanProperty(); + @FXML + private CheckMenuItem hideAmounts; + + @FXML + private ToggleButton hideAmountsToggle; + @FXML private CheckMenuItem useHdCameraResolution; private static final BooleanProperty useHdCameraResolutionProperty = new SimpleBooleanProperty(); @@ -384,6 +390,11 @@ public class AppController implements Initializable { openWalletsInNewWindows.selectedProperty().bindBidirectional(openWalletsInNewWindowsProperty); hideEmptyUsedAddressesProperty.set(Config.get().isHideEmptyUsedAddresses()); hideEmptyUsedAddresses.selectedProperty().bindBidirectional(hideEmptyUsedAddressesProperty); + hideAmounts.setSelected(Config.get().isHideAmounts()); + hideAmountsToggle.setSelected(Config.get().isHideAmounts()); + Glyph eyeGlyph = new Glyph(FontAwesome5.FONT_NAME, FontAwesome5.Glyph.EYE); + Glyph eyeSlashGlyph = new Glyph(FontAwesome5.FONT_NAME, FontAwesome5.Glyph.EYE_SLASH); + hideAmountsToggle.setGraphic(Config.get().isHideAmounts() ? eyeSlashGlyph : eyeGlyph); useHdCameraResolutionProperty.set(Config.get().getWebcamResolution() == null || Config.get().getWebcamResolution().isWidescreenAspect()); useHdCameraResolution.selectedProperty().bindBidirectional(useHdCameraResolutionProperty); mirrorCameraImageProperty.set(Config.get().isMirrorCapture()); @@ -947,6 +958,18 @@ public class AppController implements Initializable { EventManager.get().post(new HideEmptyUsedAddressesStatusEvent(item.isSelected())); } + public void hideAmounts(ActionEvent event) { + CheckMenuItem item = (CheckMenuItem)event.getSource(); + Config.get().setHideAmounts(item.isSelected()); + EventManager.get().post(new HideAmountsStatusEvent(item.isSelected())); + } + + public void toggleHideAmounts(ActionEvent event) { + boolean hideAmounts = hideAmountsToggle.isSelected(); + Config.get().setHideAmounts(hideAmounts); + EventManager.get().post(new HideAmountsStatusEvent(hideAmounts)); + } + public void useHdCameraResolution(ActionEvent event) { CheckMenuItem item = (CheckMenuItem)event.getSource(); if(Config.get().getWebcamResolution().isStandardAspect() && item.isSelected()) { @@ -3124,6 +3147,16 @@ public class AppController implements Initializable { hideEmptyUsedAddresses.setSelected(event.isHideEmptyUsedAddresses()); } + @Subscribe + public void hideAmountsStatusChanged(HideAmountsStatusEvent event) { + hideAmounts.setSelected(event.isHideAmounts()); + hideAmountsToggle.setSelected(event.isHideAmounts()); + Glyph glyph = event.isHideAmounts() ? + new Glyph(FontAwesome5.FONT_NAME, FontAwesome5.Glyph.EYE_SLASH) : + new Glyph(FontAwesome5.FONT_NAME, FontAwesome5.Glyph.EYE); + hideAmountsToggle.setGraphic(glyph); + } + @Subscribe public void requestOpenWallets(RequestOpenWalletsEvent event) { EventManager.get().post(new OpenWalletsEvent(tabs.getScene().getWindow(), getOpenWalletTabData())); diff --git a/src/main/java/com/sparrowwallet/sparrow/glyphfont/FontAwesome5.java b/src/main/java/com/sparrowwallet/sparrow/glyphfont/FontAwesome5.java index 19c532bc..08bd90e9 100644 --- a/src/main/java/com/sparrowwallet/sparrow/glyphfont/FontAwesome5.java +++ b/src/main/java/com/sparrowwallet/sparrow/glyphfont/FontAwesome5.java @@ -38,6 +38,7 @@ public class FontAwesome5 extends GlyphFont { EXTERNAL_LINK_ALT('\uf35d'), ELLIPSIS_H('\uf141'), EYE('\uf06e'), + EYE_SLASH('\uf070'), FEATHER_ALT('\uf56b'), FILE_CSV('\uf6dd'), FILE_IMPORT('\uf56f'), diff --git a/src/main/resources/com/sparrowwallet/sparrow/app.fxml b/src/main/resources/com/sparrowwallet/sparrow/app.fxml index c8d461c6..e09d64af 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/app.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/app.fxml @@ -120,6 +120,7 @@ + @@ -174,6 +175,11 @@ + + + + + From 2220769b03d2401d98f7bf08b0cd3a917d354e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kyle=20=F0=9F=90=86?= Date: Fri, 17 Oct 2025 19:57:33 -0400 Subject: [PATCH 4/8] feat: wire up hide amounts event handlers --- .../wallet/TransactionsController.java | 9 +++++ .../sparrow/wallet/UtxosController.java | 37 +++++++++++++------ 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java index d2d5191f..0111920d 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java @@ -195,6 +195,15 @@ public class TransactionsController extends WalletFormController implements Init fiatMempoolBalance.refresh(event.getUnitFormat()); } + @Subscribe + public void hideAmountsStatusChanged(HideAmountsStatusEvent event) { + transactionsTable.refresh(); + balance.refresh(); + mempoolBalance.refresh(); + fiatBalance.refresh(); + fiatMempoolBalance.refresh(); + } + @Subscribe public void fiatCurrencySelected(FiatCurrencySelectedEvent event) { if(event.getExchangeSource() == ExchangeSource.NONE) { diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java index 51bf2d61..79505e54 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java @@ -121,18 +121,22 @@ public class UtxosController extends WalletFormController implements Initializab long selectedTotal = selectedEntries.stream().mapToLong(Entry::getValue).sum(); if(selectedTotal > 0) { - if(format == null) { - format = UnitFormat.DOT; - } - - if(unit == null || unit.equals(BitcoinUnit.AUTO)) { - unit = (selectedTotal >= BitcoinUnit.getAutoThreshold() ? BitcoinUnit.BTC : BitcoinUnit.SATOSHIS); - } - - if(unit.equals(BitcoinUnit.BTC)) { - sendSelected.setText("Send Selected (" + format.formatBtcValue(selectedTotal) + " BTC)"); + if(Config.get().isHideAmounts()) { + sendSelected.setText("Send Selected"); } else { - sendSelected.setText("Send Selected (" + format.formatSatsValue(selectedTotal) + " sats)"); + if(format == null) { + format = UnitFormat.DOT; + } + + if(unit == null || unit.equals(BitcoinUnit.AUTO)) { + unit = (selectedTotal >= BitcoinUnit.getAutoThreshold() ? BitcoinUnit.BTC : BitcoinUnit.SATOSHIS); + } + + if(unit.equals(BitcoinUnit.BTC)) { + sendSelected.setText("Send Selected (" + format.formatBtcValue(selectedTotal) + " BTC)"); + } else { + sendSelected.setText("Send Selected (" + format.formatSatsValue(selectedTotal) + " sats)"); + } } } else { sendSelected.setText("Send Selected"); @@ -270,6 +274,17 @@ public class UtxosController extends WalletFormController implements Initializab fiatMempoolBalance.refresh(event.getUnitFormat()); } + @Subscribe + public void hideAmountsStatusChanged(HideAmountsStatusEvent event) { + utxosTable.refresh(); + utxosChart.update(getWalletForm().getWalletUtxosEntry()); + balance.refresh(); + mempoolBalance.refresh(); + updateButtons(Config.get().getUnitFormat(), Config.get().getBitcoinUnit()); + fiatBalance.refresh(); + fiatMempoolBalance.refresh(); + } + @Subscribe public void walletHistoryStatus(WalletHistoryStatusEvent event) { utxosTable.updateHistoryStatus(event); From 4bd622bcfc57576bf85372ae923f9a40d852fcbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kyle=20=F0=9F=90=86?= Date: Sat, 18 Oct 2025 09:27:21 -0400 Subject: [PATCH 5/8] fix: instant refresh for hide amounts toggle --- .../sparrowwallet/sparrow/control/TransactionDiagram.java | 3 +++ .../sparrow/event/NewWalletTransactionsEvent.java | 4 ++++ .../com/sparrowwallet/sparrow/wallet/PaymentController.java | 6 ++++++ .../com/sparrowwallet/sparrow/wallet/SendController.java | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java b/src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java index 46305d46..5beb8aa8 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java @@ -572,6 +572,9 @@ public class TransactionDiagram extends GridPane { } String getSatsValue(long amount) { + if(Config.get().isHideAmounts()) { + return "*****"; + } UnitFormat format = Config.get().getUnitFormat() == null ? UnitFormat.DOT : Config.get().getUnitFormat(); return format.formatSatsValue(amount); } diff --git a/src/main/java/com/sparrowwallet/sparrow/event/NewWalletTransactionsEvent.java b/src/main/java/com/sparrowwallet/sparrow/event/NewWalletTransactionsEvent.java index 69235ae7..a59a4153 100644 --- a/src/main/java/com/sparrowwallet/sparrow/event/NewWalletTransactionsEvent.java +++ b/src/main/java/com/sparrowwallet/sparrow/event/NewWalletTransactionsEvent.java @@ -48,6 +48,10 @@ public class NewWalletTransactionsEvent { } public String getValueAsText(long value) { + if(Config.get().isHideAmounts()) { + return "*****"; + } + UnitFormat format = Config.get().getUnitFormat(); if(format == null) { format = UnitFormat.DOT; diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java index d15e905a..b1fc2b4a 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java @@ -405,6 +405,7 @@ public class PaymentController extends WalletFormController implements Initializ DecimalFormat df = new DecimalFormat("#.#", unitFormat.getDecimalFormatSymbols()); df.setMaximumFractionDigits(8); amount.setText(df.format(newValue.getValue(value))); + setFiatAmount(AppServices.getFiatCurrencyExchangeRate(), value); } }); @@ -923,6 +924,11 @@ public class PaymentController extends WalletFormController implements Initializ updateOpenWallets(event.getWallets()); } + @Subscribe + public void hideAmountsStatusChanged(HideAmountsStatusEvent event) { + fiatAmount.refresh(Config.get().getUnitFormat()); + } + private static class DnsPaymentService extends Service> { private final String hrn; diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java index 63907943..618633fa 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java @@ -1635,6 +1635,11 @@ public class SendController extends WalletFormController implements Initializabl } } + @Subscribe + public void hideAmountsStatusChanged(HideAmountsStatusEvent event) { + updateTransaction(); + } + private class PrivacyAnalysisTooltip extends VBox { private final List