diff --git a/Classes/css/user/ContainerScrollStyleSheet.java b/Classes/css/user/ContainerScrollStyleSheet.java index f47f265..551af47 100644 --- a/Classes/css/user/ContainerScrollStyleSheet.java +++ b/Classes/css/user/ContainerScrollStyleSheet.java @@ -2,7 +2,12 @@ package Classes.css.user; import Classes.css.core.Context; import Classes.css.core.Ruleset; +import javafx.beans.value.ChangeListener; +import javafx.beans.value.ObservableValue; +import javafx.geometry.Bounds; import javafx.scene.Node; +import javafx.scene.control.ScrollPane; +import javafx.scene.layout.FlowPane; public class ContainerScrollStyleSheet{ @@ -16,6 +21,22 @@ public class ContainerScrollStyleSheet{ .add("right", 0) // .add("pref-height", ) .apply(); + + /* (2) Manage dynamic 1st children bounds to it */ + ScrollPane spane = (ScrollPane) target; + + spane.layoutBoundsProperty().addListener(new ChangeListener(){ + + @Override + public void changed(ObservableValue observable, Object oldValue, Object newValue) { + System.out.println(spane.getLayoutBounds().getWidth()); + FlowPane child = (FlowPane) spane.getContent(); + child.setPrefWidth( spane.getLayoutBounds().getWidth() ); + child.setPrefHeight( spane.getLayoutBounds().getHeight() ); + + } + }); + } } diff --git a/fxml/model.fxml b/fxml/model.fxml index 1315751..8174cba 100644 --- a/fxml/model.fxml +++ b/fxml/model.fxml @@ -2,13 +2,13 @@ + - @@ -312,60 +312,47 @@ - + - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +