From 74df7a723d5d4e9bc6bef4074bba4f4b9fbd3c58 Mon Sep 17 00:00:00 2001 From: msteyt Date: Sat, 5 May 2018 12:05:19 +0200 Subject: [PATCH 1/3] Fix for issue #803 --- .../controlsfx/skin/CustomTextFieldSkin.java | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/controlsfx/src/main/java/impl/org/controlsfx/skin/CustomTextFieldSkin.java b/controlsfx/src/main/java/impl/org/controlsfx/skin/CustomTextFieldSkin.java index 00aa8f699..a4825f3da 100644 --- a/controlsfx/src/main/java/impl/org/controlsfx/skin/CustomTextFieldSkin.java +++ b/controlsfx/src/main/java/impl/org/controlsfx/skin/CustomTextFieldSkin.java @@ -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); @@ -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); @@ -148,9 +150,24 @@ 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 pw = 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 pw + leftWidth + rightWidth; + } + + @Override + protected double computeMinHeight(double w, double topInset, double rightInset, double bottomInset, double leftInset) + { + final double ph = 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(ph, Math.max(leftHeight, rightHeight)); + } } From d50d02b7dc2e2173db66fe8a87dda5561961a79e Mon Sep 17 00:00:00 2001 From: msteyt Date: Mon, 3 Sep 2018 15:45:34 +0200 Subject: [PATCH 2/3] Fix for issue #803 (rename local variables as requested) (grafted from 6debf255189f4942bf161f8096d1a9bd1b8ec414) --- .../impl/org/controlsfx/skin/CustomTextFieldSkin.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/controlsfx/src/main/java/impl/org/controlsfx/skin/CustomTextFieldSkin.java b/controlsfx/src/main/java/impl/org/controlsfx/skin/CustomTextFieldSkin.java index a4825f3da..5ba63a482 100644 --- a/controlsfx/src/main/java/impl/org/controlsfx/skin/CustomTextFieldSkin.java +++ b/controlsfx/src/main/java/impl/org/controlsfx/skin/CustomTextFieldSkin.java @@ -154,20 +154,20 @@ protected double computePrefHeight(double w, double topInset, double rightInset, @Override protected double computeMinWidth(double h, double topInset, double rightInset, double bottomInset, double leftInset) { - final double pw = super.computeMinWidth(h, topInset, rightInset, bottomInset, 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 pw + leftWidth + rightWidth; + return mw + leftWidth + rightWidth; } @Override protected double computeMinHeight(double w, double topInset, double rightInset, double bottomInset, double leftInset) { - final double ph = super.computeMinHeight(w, topInset, rightInset, bottomInset, 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(ph, Math.max(leftHeight, rightHeight)); + return Math.max(mh, Math.max(leftHeight, rightHeight)); } } From b31c0eea888f708f6df346ae8d2f896adc46652c Mon Sep 17 00:00:00 2001 From: msteyt Date: Thu, 6 Sep 2018 16:14:21 +0200 Subject: [PATCH 3/3] Fix for issue #803 (following java code conventions) --- .../java/impl/org/controlsfx/skin/CustomTextFieldSkin.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/controlsfx/src/main/java/impl/org/controlsfx/skin/CustomTextFieldSkin.java b/controlsfx/src/main/java/impl/org/controlsfx/skin/CustomTextFieldSkin.java index 5ba63a482..4ec2c4132 100644 --- a/controlsfx/src/main/java/impl/org/controlsfx/skin/CustomTextFieldSkin.java +++ b/controlsfx/src/main/java/impl/org/controlsfx/skin/CustomTextFieldSkin.java @@ -152,8 +152,7 @@ protected double computePrefHeight(double w, double topInset, double rightInset, } @Override - protected double computeMinWidth(double h, double topInset, double rightInset, double bottomInset, double leftInset) - { + 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)); @@ -162,8 +161,7 @@ protected double computeMinWidth(double h, double topInset, double rightInset, d } @Override - protected double computeMinHeight(double w, double topInset, double rightInset, double bottomInset, double leftInset) - { + 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));