From 34c9bc9b6947284abcf67afd1691a863c62fa392 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 2 Feb 2022 17:04:38 +0200 Subject: [PATCH] followup #2 --- .../sparrow/control/TransactionDiagram.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java b/src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java index 85f265c0..ac022876 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/TransactionDiagram.java @@ -371,7 +371,7 @@ public class TransactionDiagram extends GridPane { inputsBox.setPrefWidth(isExpanded() ? 230 : 150); inputsBox.setPadding(new Insets(0, 10, 0, 10)); inputsBox.minHeightProperty().bind(minHeightProperty()); - inputsBox.setAlignment(Pos.CENTER_RIGHT); + inputsBox.setAlignment(Pos.BASELINE_RIGHT); inputsBox.getChildren().add(createSpacer()); Label helper = new Label(); double labelHeight = Math.max(TextUtils.computeTextHeight(AppServices.getMonospaceFont(), "0"), TextUtils.computeTextHeight(helper.getFont(), "0")) + 1; @@ -409,6 +409,7 @@ public class TransactionDiagram extends GridPane { if(input instanceof PayjoinBlockTransactionHashIndex) { tooltip.setText("Added once transaction is signed and sent to the payjoin server"); } else if(input instanceof AdditionalBlockTransactionHashIndex additionalReference) { + inputValue = input.getValue(); StringJoiner joiner = new StringJoiner("\n"); for(BlockTransactionHashIndex additionalInput : additionalReference.getAdditionalInputs()) { joiner.add(getInputDescription(additionalInput)); @@ -436,6 +437,11 @@ public class TransactionDiagram extends GridPane { } label.getStyleClass().add("input-label"); } + if(!isFinal()) { + label.setGraphic(excludeUtxoButton); + label.setContentDisplay(ContentDisplay.LEFT); + excludeUtxoButton.setVisible(false); + } tooltip.getStyleClass().add("input-label"); } tooltip.setShowDelay(new Duration(TOOLTIP_SHOW_DELAY)); @@ -1086,6 +1092,11 @@ public class TransactionDiagram extends GridPane { return additionalInputs.size() + " more..."; } + @Override + public long getValue() { + return additionalInputs.stream().mapToLong(BlockTransactionHashIndex::getValue).sum(); + } + public List getAdditionalInputs() { return additionalInputs; }