This commit is contained in:
Craig Raw 2022-02-02 17:04:38 +02:00
parent 5fa048d242
commit 34c9bc9b69

View file

@ -371,7 +371,7 @@ public class TransactionDiagram extends GridPane {
inputsBox.setPrefWidth(isExpanded() ? 230 : 150); inputsBox.setPrefWidth(isExpanded() ? 230 : 150);
inputsBox.setPadding(new Insets(0, 10, 0, 10)); inputsBox.setPadding(new Insets(0, 10, 0, 10));
inputsBox.minHeightProperty().bind(minHeightProperty()); inputsBox.minHeightProperty().bind(minHeightProperty());
inputsBox.setAlignment(Pos.CENTER_RIGHT); inputsBox.setAlignment(Pos.BASELINE_RIGHT);
inputsBox.getChildren().add(createSpacer()); inputsBox.getChildren().add(createSpacer());
Label helper = new Label(); Label helper = new Label();
double labelHeight = Math.max(TextUtils.computeTextHeight(AppServices.getMonospaceFont(), "0"), TextUtils.computeTextHeight(helper.getFont(), "0")) + 1; 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) { if(input instanceof PayjoinBlockTransactionHashIndex) {
tooltip.setText("Added once transaction is signed and sent to the payjoin server"); tooltip.setText("Added once transaction is signed and sent to the payjoin server");
} else if(input instanceof AdditionalBlockTransactionHashIndex additionalReference) { } else if(input instanceof AdditionalBlockTransactionHashIndex additionalReference) {
inputValue = input.getValue();
StringJoiner joiner = new StringJoiner("\n"); StringJoiner joiner = new StringJoiner("\n");
for(BlockTransactionHashIndex additionalInput : additionalReference.getAdditionalInputs()) { for(BlockTransactionHashIndex additionalInput : additionalReference.getAdditionalInputs()) {
joiner.add(getInputDescription(additionalInput)); joiner.add(getInputDescription(additionalInput));
@ -436,6 +437,11 @@ public class TransactionDiagram extends GridPane {
} }
label.getStyleClass().add("input-label"); label.getStyleClass().add("input-label");
} }
if(!isFinal()) {
label.setGraphic(excludeUtxoButton);
label.setContentDisplay(ContentDisplay.LEFT);
excludeUtxoButton.setVisible(false);
}
tooltip.getStyleClass().add("input-label"); tooltip.getStyleClass().add("input-label");
} }
tooltip.setShowDelay(new Duration(TOOLTIP_SHOW_DELAY)); tooltip.setShowDelay(new Duration(TOOLTIP_SHOW_DELAY));
@ -1086,6 +1092,11 @@ public class TransactionDiagram extends GridPane {
return additionalInputs.size() + " more..."; return additionalInputs.size() + " more...";
} }
@Override
public long getValue() {
return additionalInputs.stream().mapToLong(BlockTransactionHashIndex::getValue).sum();
}
public List<BlockTransactionHashIndex> getAdditionalInputs() { public List<BlockTransactionHashIndex> getAdditionalInputs() {
return additionalInputs; return additionalInputs;
} }