From 1f8ab609d32d8c2cd2db9e7a643a2f9c51738611 Mon Sep 17 00:00:00 2001 From: sowgro Date: Sun, 21 Jul 2024 02:52:14 -0400 Subject: New json api and more refactoring --- src/main/java/net/sowgro/npehero/devmenu/DiffEditor.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/main/java/net/sowgro/npehero/devmenu/DiffEditor.java') diff --git a/src/main/java/net/sowgro/npehero/devmenu/DiffEditor.java b/src/main/java/net/sowgro/npehero/devmenu/DiffEditor.java index de9aad8..f5c29bd 100755 --- a/src/main/java/net/sowgro/npehero/devmenu/DiffEditor.java +++ b/src/main/java/net/sowgro/npehero/devmenu/DiffEditor.java @@ -84,10 +84,12 @@ public class DiffEditor extends Pane HBox content = new HBox(); ScrollPane scroll = new ScrollPane(content); + scroll.setFitToWidth(true); this.scroll = scroll; scroll.getStyleClass().remove("scroll-pane"); scroll.getStyleClass().add("box"); - scroll.setPrefHeight(400); +// scroll.setPrefHeight(400); + scroll.prefWidthProperty().bind(scroll.heightProperty().multiply(0.66)); Pane[] lanes = new Pane[5]; for (int i = 0; i < lanes.length; i++) { @@ -95,6 +97,8 @@ public class DiffEditor extends Pane } content.getChildren().addAll(lanes); + content.setSpacing(5); + content.setAlignment(Pos.CENTER); diff.notes.list.forEach(n -> lanes[n.lane].getChildren().add(drawNote(n))); @@ -105,7 +109,10 @@ public class DiffEditor extends Pane validNotes.setInvalid("This difficulty does not contain any notes!"); } HBox notesLabel = new HBox(new Label("Notes"), validNotes); - notePreview.getChildren().addAll(notesLabel, scroll, editNotes, oldEditNotes); + Pane scrollHolder = new Pane(scroll); + scroll.prefHeightProperty().bind(scrollHolder.heightProperty()); + scrollHolder.setPrefHeight(400); + notePreview.getChildren().addAll(notesLabel, scrollHolder, editNotes, oldEditNotes); notePreview.setSpacing(10); VBox left = new VBox(); -- cgit v1.2.3