changeset 4846:c52ac94b9d02

RT-24920: [CheckBox, RadioButton] Layout regression (was: Text Overrun incorrect work in CheckBox and RadioButton)
author leifs
date Thu, 29 Aug 2013 12:48:31 -0700
parents 9b8894841264
children b2d31f6fb68d
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/LabeledSkinBase.java
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/LabeledSkinBase.java	Thu Aug 29 15:58:24 2013 +1200
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/LabeledSkinBase.java	Thu Aug 29 12:48:31 2013 -0700
@@ -538,7 +538,7 @@
             if (w == -1) {
                 w = availableWidth;
             }
-            double minW = Math.min(computeMinWidth(-1, snappedTopInset() , snappedRightInset(), snappedBottomInset(), snappedLeftInset()), availableWidth);
+            double minW = Math.min(computeMinLabeledPartWidth(-1, snappedTopInset() , snappedRightInset(), snappedBottomInset(), snappedLeftInset()), availableWidth);
             if (horizontalPosition && !isIgnoreGraphic()) {
                 double graphicW = (labeled.getGraphic().getLayoutBounds().getWidth() + labeled.getGraphicTextGap());
                 w -= graphicW;
@@ -557,7 +557,7 @@
             if (h == -1) {
                 h = availableHeight;
             }
-            double minH = Math.min(computeMinHeight(wrapWidth, snappedTopInset() , snappedRightInset(), snappedBottomInset(), snappedLeftInset()), availableHeight);
+            double minH = Math.min(computeMinLabeledPartHeight(wrapWidth, snappedTopInset() , snappedRightInset(), snappedBottomInset(), snappedLeftInset()), availableHeight);
             if (verticalPosition && labeled.getGraphic() != null) {
                 double graphicH = labeled.getGraphic().getLayoutBounds().getHeight() + labeled.getGraphicTextGap();
                 h -= graphicH;
@@ -722,6 +722,10 @@
      * the width of the "..." is as small as it will ever get.
      */
     @Override protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {
+        return computeMinLabeledPartWidth(height, topInset, rightInset, bottomInset, leftInset);
+    }
+
+    private double computeMinLabeledPartWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {
         // First compute the minTextWidth by checking the width of the string
         // made by the ellipsis "...", and then by checking the width of the
         // string made up by labeled.text. We want the smaller of the two.
@@ -774,6 +778,10 @@
     }
 
     @Override protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) {
+        return computeMinLabeledPartHeight(width, topInset, rightInset, bottomInset, leftInset);
+    }
+
+    private double computeMinLabeledPartHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) {
         final Labeled labeled = getSkinnable();
         final Font font = text.getFont();