From cc83e3eb0fc823ae33d4fb9db53d91bcba578bbd Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Thu, 8 Feb 2024 11:33:46 -0500 Subject: [PATCH] Make positioning of category and vendor in transaction tile consistent. --- .../perfin/view/component/TransactionTile.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/andrewlalis/perfin/view/component/TransactionTile.java b/src/main/java/com/andrewlalis/perfin/view/component/TransactionTile.java index c125267..93c13d4 100644 --- a/src/main/java/com/andrewlalis/perfin/view/component/TransactionTile.java +++ b/src/main/java/com/andrewlalis/perfin/view/component/TransactionTile.java @@ -104,14 +104,16 @@ public class TransactionTile extends BorderPane { } private Node getExtra(Transaction transaction) { - VBox content = new VBox(); + VBox categoryContainer = new VBox(); + VBox vendorContainer = new VBox(); + VBox content = new VBox(categoryContainer, vendorContainer); if (transaction.getCategoryId() != null) { Profile.getCurrent().dataSource().mapRepoAsync( TransactionCategoryRepository.class, repo -> repo.findById(transaction.getCategoryId()).orElse(null) ).thenAccept(category -> { if (category == null) return; - Platform.runLater(() -> content.getChildren().add(new CategoryLabel(category))); + Platform.runLater(() -> categoryContainer.getChildren().add(new CategoryLabel(category))); }); } if (transaction.getVendorId() != null) { @@ -120,7 +122,7 @@ public class TransactionTile extends BorderPane { repo -> repo.findById(transaction.getVendorId()).orElse(null) ).thenAccept(vendor -> { if (vendor == null) return; - Platform.runLater(() -> content.getChildren().addLast(new Text("@ " + vendor.getName()))); + Platform.runLater(() -> vendorContainer.getChildren().add(new Text("@ " + vendor.getName()))); }); } return content;