From fe9794bdc8270b43ed5ae847d65ea2a2eecd4a79 Mon Sep 17 00:00:00 2001 From: sowgro Date: Thu, 18 May 2023 08:51:31 -0400 Subject: fix resizing and the bottom being too long --- src/gui/LevelSelector.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/gui/LevelSelector.java') diff --git a/src/gui/LevelSelector.java b/src/gui/LevelSelector.java index 5600b07..9ae6033 100644 --- a/src/gui/LevelSelector.java +++ b/src/gui/LevelSelector.java @@ -21,8 +21,8 @@ public class LevelSelector extends Pane ListView levels = new ListView(); ObservableList levelList= FXCollections.observableArrayList ("Test Level 1", "Test Level 2", "Test Level 3", "Test Level 4"); levels.setItems(levelList); - levels.minWidthProperty().bind(super.widthProperty().multiply(0.25)); - levels.minHeightProperty().bind(super.heightProperty().multiply(0.75)); + levels.prefWidthProperty().bind(super.prefWidthProperty().multiply(0.25)); + levels.prefHeightProperty().bind(super.prefHeightProperty().multiply(0.75)); Button exit = new Button(); exit.setText("Exit"); @@ -38,8 +38,8 @@ public class LevelSelector extends Pane HBox rootBox = new HBox(); - rootBox.minWidthProperty().bind(super.widthProperty()); - rootBox.minHeightProperty().bind(super.heightProperty()); + rootBox.prefWidthProperty().bind(super.prefWidthProperty()); + rootBox.prefHeightProperty().bind(super.prefHeightProperty()); rootBox.getChildren().addAll(leftBox, rightBox); rootBox.setAlignment(Pos.CENTER); rootBox.setSpacing(10); @@ -56,10 +56,10 @@ public class LevelSelector extends Pane rightBox.getChildren().remove(0); } rightBox.getChildren().add(details); - details.minWidthProperty().bind(super.widthProperty().multiply(0.37)); - details.minHeightProperty().bind(super.heightProperty()); - details.maxWidthProperty().bind(super.widthProperty().multiply(0.37)); - details.maxHeightProperty().bind(super.heightProperty()); + details.prefWidthProperty().bind(super.prefWidthProperty().multiply(0.37)); + details.prefHeightProperty().bind(super.prefHeightProperty()); + details.maxWidthProperty().bind(super.prefWidthProperty().multiply(0.37)); + details.maxHeightProperty().bind(super.prefHeightProperty()); } } -- cgit v1.2.3