Skip to content

Commit

Permalink
Merged in msteyt/controlsfx05052018 (pull request #704)
Browse files Browse the repository at this point in the history
Fix for issue #803

Approved-by: Abhinay Agarwal <abhinay.agarwal@gluonhq.com>
Approved-by: Jonathan Giles <jonathan@jonathangiles.net>
  • Loading branch information
JonathanGiles committed Sep 17, 2018
2 parents 815ddcb + b31c0ee commit 51fa5d3
Showing 1 changed file with 20 additions and 5 deletions.
Expand Up @@ -77,6 +77,7 @@ private void updateChildren() {
if (newLeft != null) {
getChildren().remove(leftPane);
leftPane = new StackPane(newLeft);
leftPane.setManaged(false);
leftPane.setAlignment(Pos.CENTER_LEFT);
leftPane.getStyleClass().add("left-pane"); //$NON-NLS-1$
getChildren().add(leftPane);
Expand All @@ -87,6 +88,7 @@ private void updateChildren() {
if (newRight != null) {
getChildren().remove(rightPane);
rightPane = new StackPane(newRight);
rightPane.setManaged(false);
rightPane.setAlignment(Pos.CENTER_RIGHT);
rightPane.getStyleClass().add("right-pane"); //$NON-NLS-1$
getChildren().add(rightPane);
Expand Down Expand Up @@ -148,9 +150,22 @@ protected double computePrefHeight(double w, double topInset, double rightInset,

return Math.max(ph, Math.max(leftHeight, rightHeight));
}
//
// @Override
// protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {
// return computePrefWidth(height, topInset, rightInset, bottomInset, leftInset);
//}

@Override
protected double computeMinWidth(double h, double topInset, double rightInset, double bottomInset, double leftInset) {
final double mw = super.computeMinWidth(h, topInset, rightInset, bottomInset, leftInset);
final double leftWidth = leftPane == null ? 0.0 : snapSize(leftPane.minWidth(h));
final double rightWidth = rightPane == null ? 0.0 : snapSize(rightPane.minWidth(h));

return mw + leftWidth + rightWidth;
}

@Override
protected double computeMinHeight(double w, double topInset, double rightInset, double bottomInset, double leftInset) {
final double mh = super.computeMinHeight(w, topInset, rightInset, bottomInset, leftInset);
final double leftHeight = leftPane == null ? 0.0 : snapSize(leftPane.minHeight(-1));
final double rightHeight = rightPane == null ? 0.0 : snapSize(rightPane.minHeight(-1));

return Math.max(mh, Math.max(leftHeight, rightHeight));
}
}

0 comments on commit 51fa5d3

Please sign in to comment.