support send and display of pay to anchor outputs

This commit is contained in:
Craig Raw
2025-04-14 15:50:10 +02:00
parent 5edabf2e14
commit af8505c0eb
4 changed files with 12 additions and 2 deletions

2
drongo

Submodule drongo updated: 3b36947419...abb598d3b0

View File

@@ -676,7 +676,7 @@ public class TransactionDiagram extends GridPane {
List<OutputNode> outputNodes = new ArrayList<>(); List<OutputNode> outputNodes = new ArrayList<>();
for(Payment payment : displayedPayments) { for(Payment payment : displayedPayments) {
Glyph outputGlyph = GlyphUtils.getOutputGlyph(walletTx, payment); Glyph outputGlyph = GlyphUtils.getOutputGlyph(walletTx, payment);
boolean labelledPayment = outputGlyph.getStyleClass().stream().anyMatch(style -> List.of("premix-icon", "badbank-icon", "whirlpoolfee-icon").contains(style)) || payment instanceof AdditionalPayment; boolean labelledPayment = outputGlyph.getStyleClass().stream().anyMatch(style -> List.of("premix-icon", "badbank-icon", "whirlpoolfee-icon", "anchor-icon").contains(style)) || payment instanceof AdditionalPayment || payment.getLabel() != null;
Label recipientLabel = new Label(payment.getLabel() == null || payment.getType() == Payment.Type.FAKE_MIX || payment.getType() == Payment.Type.MIX ? payment.getAddress().toString().substring(0, 8) + "..." : payment.getLabel(), outputGlyph); Label recipientLabel = new Label(payment.getLabel() == null || payment.getType() == Payment.Type.FAKE_MIX || payment.getType() == Payment.Type.MIX ? payment.getAddress().toString().substring(0, 8) + "..." : payment.getLabel(), outputGlyph);
recipientLabel.getStyleClass().add("output-label"); recipientLabel.getStyleClass().add("output-label");
recipientLabel.getStyleClass().add(labelledPayment ? "payment-label" : "recipient-label"); recipientLabel.getStyleClass().add(labelledPayment ? "payment-label" : "recipient-label");

View File

@@ -16,6 +16,7 @@ public class FontAwesome5 extends GlyphFont {
*/ */
public static enum Glyph implements INamedCharacter { public static enum Glyph implements INamedCharacter {
ADJUST('\uf042'), ADJUST('\uf042'),
ANCHOR('\uf13d'),
ARROW_CIRCLE_DOWN('\uf0ab'), ARROW_CIRCLE_DOWN('\uf0ab'),
ANGLE_DOUBLE_RIGHT('\uf101'), ANGLE_DOUBLE_RIGHT('\uf101'),
ARROW_DOWN('\uf063'), ARROW_DOWN('\uf063'),

View File

@@ -13,6 +13,8 @@ public class GlyphUtils {
return getMixGlyph(); return getMixGlyph();
} else if(payment.getType().equals(Payment.Type.FAKE_MIX)) { } else if(payment.getType().equals(Payment.Type.FAKE_MIX)) {
return getFakeMixGlyph(); return getFakeMixGlyph();
} else if(payment.getType().equals(Payment.Type.ANCHOR)) {
return getAnchorGlyph();
} else if(walletTx.isConsolidationSend(payment)) { } else if(walletTx.isConsolidationSend(payment)) {
return getConsolidationGlyph(); return getConsolidationGlyph();
} else if(walletTx.isPremixSend(payment)) { } else if(walletTx.isPremixSend(payment)) {
@@ -217,4 +219,11 @@ public class GlyphUtils {
downGlyph.setFontSize(12); downGlyph.setFontSize(12);
return downGlyph; return downGlyph;
} }
public static Glyph getAnchorGlyph() {
Glyph anchorGlyph = new Glyph(FontAwesome5.FONT_NAME, FontAwesome5.Glyph.ANCHOR);
anchorGlyph.getStyleClass().add("anchor-icon");
anchorGlyph.setFontSize(12);
return anchorGlyph;
}
} }