From e92d0f9b586abed56ea06051296bc94070f888fe Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 16 Jan 2025 14:21:42 +0200 Subject: [PATCH] show input label in input tooltip on transaction diagram if present --- .../sparrow/control/TransactionDiagram.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java b/src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java index da55d362..3d9728b6 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java @@ -432,8 +432,14 @@ public class TransactionDiagram extends GridPane { if(walletNode != null) { inputValue = input.getValue(); Wallet nodeWallet = walletNode.getWallet(); - tooltip.setText("Spending " + getSatsValue(inputValue) + " sats from " + (isFinal() ? nodeWallet.getFullDisplayName() : (nodeWallet.isNested() ? nodeWallet.getDisplayName() : "")) + " " + walletNode + "\n" + - input.getHashAsString() + ":" + input.getIndex() + "\n" + walletNode.getAddress()); + StringJoiner joiner = new StringJoiner("\n"); + joiner.add("Spending " + getSatsValue(inputValue) + " sats from " + (isFinal() ? nodeWallet.getFullDisplayName() : (nodeWallet.isNested() ? nodeWallet.getDisplayName() : "")) + " " + walletNode); + joiner.add(input.getHashAsString() + ":" + input.getIndex()); + joiner.add(walletNode.getAddress().toString()); + if(input.getLabel() != null) { + joiner.add(input.getLabel()); + } + tooltip.setText(joiner.toString()); tooltip.getStyleClass().add("input-label"); if(input.getLabel() == null || input.getLabel().isEmpty()) {