From eefbb1c09b16fd459f070c131e4350f1d972219e Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Wed, 31 Jan 2024 11:21:54 -0500 Subject: [PATCH] Compacted the amount and currency fields. --- .../validation/decorators/FieldSubtextDecorator.java | 4 ++++ src/main/resources/edit-transaction.fxml | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/andrewlalis/perfin/view/component/validation/decorators/FieldSubtextDecorator.java b/src/main/java/com/andrewlalis/perfin/view/component/validation/decorators/FieldSubtextDecorator.java index 14f41ef..d386211 100644 --- a/src/main/java/com/andrewlalis/perfin/view/component/validation/decorators/FieldSubtextDecorator.java +++ b/src/main/java/com/andrewlalis/perfin/view/component/validation/decorators/FieldSubtextDecorator.java @@ -4,6 +4,7 @@ import com.andrewlalis.perfin.view.component.validation.ValidationDecorator; import com.andrewlalis.perfin.view.component.validation.ValidationResult; import javafx.scene.Node; import javafx.scene.control.Label; +import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; import org.slf4j.Logger; @@ -55,6 +56,9 @@ public class FieldSubtextDecorator implements ValidationDecorator { errorLabel.getStyleClass().addAll("small-font", "negative-color-text-fill"); errorLabel.setWrapText(true); VBox validationContainer = new VBox(node, errorLabel); + if (trueParent instanceof HBox) { + HBox.setHgrow(validationContainer, HBox.getHgrow(node)); + } validationContainer.setUserData(WRAP_KEY); trueParent.getChildren().add(idx, validationContainer); return errorLabel; diff --git a/src/main/resources/edit-transaction.fxml b/src/main/resources/edit-transaction.fxml index 1d0900b..4a54347 100644 --- a/src/main/resources/edit-transaction.fxml +++ b/src/main/resources/edit-transaction.fxml @@ -27,10 +27,10 @@