mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-11-05 11:56:37 +00:00
fix: refresh amounts instantly on hide toggle
This commit is contained in:
parent
4bd622bcfc
commit
a8bb094605
9 changed files with 49 additions and 0 deletions
|
|
@ -284,6 +284,10 @@ public class TransactionDiagram extends GridPane {
|
||||||
contextMenu.getItems().add(menuItem);
|
contextMenu.getItems().add(menuItem);
|
||||||
setOnContextMenuRequested(contextMenuHandler);
|
setOnContextMenuRequested(contextMenuHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(getLabel() != null) {
|
||||||
|
getLabel().update(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Map<BlockTransactionHashIndex, WalletNode>> getDisplayedUtxoSets() {
|
private List<Map<BlockTransactionHashIndex, WalletNode>> getDisplayedUtxoSets() {
|
||||||
|
|
|
||||||
|
|
@ -133,4 +133,15 @@ public class UtxosChart extends BarChart<String, Number> {
|
||||||
NumberAxis yaxis = (NumberAxis)getYAxis();
|
NumberAxis yaxis = (NumberAxis)getYAxis();
|
||||||
yaxis.setTickLabelFormatter(new CoinAxisFormatter(yaxis, format, unit));
|
yaxis.setTickLabelFormatter(new CoinAxisFormatter(yaxis, format, unit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void refreshAxisLabels() {
|
||||||
|
NumberAxis yaxis = (NumberAxis)getYAxis();
|
||||||
|
// Force the axis to redraw by invalidating the upper and lower bounds
|
||||||
|
yaxis.setAutoRanging(false);
|
||||||
|
double lower = yaxis.getLowerBound();
|
||||||
|
double upper = yaxis.getUpperBound();
|
||||||
|
yaxis.setLowerBound(lower);
|
||||||
|
yaxis.setUpperBound(upper);
|
||||||
|
yaxis.setAutoRanging(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1781,6 +1781,12 @@ public class HeadersController extends TransactionFormController implements Init
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
||||||
|
transactionDiagram.update();
|
||||||
|
fee.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
private static class WalletSignComparator implements Comparator<Wallet> {
|
private static class WalletSignComparator implements Comparator<Wallet> {
|
||||||
private static final List<KeystoreSource> sourceOrder = List.of(KeystoreSource.SW_WATCH, KeystoreSource.HW_AIRGAPPED, KeystoreSource.HW_USB, KeystoreSource.SW_SEED);
|
private static final List<KeystoreSource> sourceOrder = List.of(KeystoreSource.SW_WATCH, KeystoreSource.HW_AIRGAPPED, KeystoreSource.HW_USB, KeystoreSource.SW_SEED);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -578,4 +578,9 @@ public class InputController extends TransactionFormController implements Initia
|
||||||
updateInputLegendFromWallet(inputForm.getTransactionInput(), null);
|
updateInputLegendFromWallet(inputForm.getTransactionInput(), null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
||||||
|
spends.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -184,4 +184,9 @@ public class InputsController extends TransactionFormController implements Initi
|
||||||
updatePSBTInputs(inputsForm.getPsbt());
|
updatePSBTInputs(inputsForm.getPsbt());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
||||||
|
total.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -228,4 +228,9 @@ public class OutputController extends TransactionFormController implements Initi
|
||||||
updateScriptPubKey(outputForm.getTransactionOutput());
|
updateScriptPubKey(outputForm.getTransactionOutput());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
||||||
|
value.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.sparrowwallet.drongo.protocol.TransactionOutput;
|
||||||
import com.sparrowwallet.sparrow.EventManager;
|
import com.sparrowwallet.sparrow.EventManager;
|
||||||
import com.sparrowwallet.sparrow.control.CopyableCoinLabel;
|
import com.sparrowwallet.sparrow.control.CopyableCoinLabel;
|
||||||
import com.sparrowwallet.sparrow.control.CopyableLabel;
|
import com.sparrowwallet.sparrow.control.CopyableLabel;
|
||||||
|
import com.sparrowwallet.sparrow.event.HideAmountsStatusEvent;
|
||||||
import com.sparrowwallet.sparrow.event.TransactionOutputsChangedEvent;
|
import com.sparrowwallet.sparrow.event.TransactionOutputsChangedEvent;
|
||||||
import com.sparrowwallet.sparrow.event.UnitFormatChangedEvent;
|
import com.sparrowwallet.sparrow.event.UnitFormatChangedEvent;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
|
|
@ -68,4 +69,9 @@ public class OutputsController extends TransactionFormController implements Init
|
||||||
updatePieData(outputsPie, outputsForm.getTransaction().getOutputs());
|
updatePieData(outputsPie, outputsForm.getTransaction().getOutputs());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
||||||
|
total.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,12 @@ public class AddressesController extends WalletFormController implements Initial
|
||||||
changeTable.showTransactionsCount(event.isShowCount());
|
changeTable.showTransactionsCount(event.isShowCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
||||||
|
receiveTable.refresh();
|
||||||
|
changeTable.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
public void exportReceiveAddresses(ActionEvent event) {
|
public void exportReceiveAddresses(ActionEvent event) {
|
||||||
exportAddresses(KeyPurpose.RECEIVE);
|
exportAddresses(KeyPurpose.RECEIVE);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -278,6 +278,7 @@ public class UtxosController extends WalletFormController implements Initializab
|
||||||
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
||||||
utxosTable.refresh();
|
utxosTable.refresh();
|
||||||
utxosChart.update(getWalletForm().getWalletUtxosEntry());
|
utxosChart.update(getWalletForm().getWalletUtxosEntry());
|
||||||
|
utxosChart.refreshAxisLabels();
|
||||||
balance.refresh();
|
balance.refresh();
|
||||||
mempoolBalance.refresh();
|
mempoolBalance.refresh();
|
||||||
updateButtons(Config.get().getUnitFormat(), Config.get().getBitcoinUnit());
|
updateButtons(Config.get().getUnitFormat(), Config.get().getBitcoinUnit());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue