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

@ -1 +1 @@
Subproject commit 3b36947419ddefce21f62b765f0fda9cc32fac42
Subproject commit abb598d3b041a9d0b3d0ba41b5fb9785e2100193

View File

@ -676,7 +676,7 @@ public class TransactionDiagram extends GridPane {
List<OutputNode> outputNodes = new ArrayList<>();
for(Payment payment : displayedPayments) {
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);
recipientLabel.getStyleClass().add("output-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 {
ADJUST('\uf042'),
ANCHOR('\uf13d'),
ARROW_CIRCLE_DOWN('\uf0ab'),
ANGLE_DOUBLE_RIGHT('\uf101'),
ARROW_DOWN('\uf063'),

View File

@ -13,6 +13,8 @@ public class GlyphUtils {
return getMixGlyph();
} else if(payment.getType().equals(Payment.Type.FAKE_MIX)) {
return getFakeMixGlyph();
} else if(payment.getType().equals(Payment.Type.ANCHOR)) {
return getAnchorGlyph();
} else if(walletTx.isConsolidationSend(payment)) {
return getConsolidationGlyph();
} else if(walletTx.isPremixSend(payment)) {
@ -217,4 +219,11 @@ public class GlyphUtils {
downGlyph.setFontSize(12);
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;
}
}