changeset 5497:9775cb0a69c9

RT-33186 TabPane: After set style "-fx-tab-min-width" focus render is incorrectly Reviewed-by: psomashe, jgiles
author Martin Sladecek <martin.sladecek@oracle.com>
date Wed, 23 Oct 2013 09:34:33 +0200
parents c5e80d3a9fd1
children 0c90b4063ae7
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TabPaneSkin.java
diffstat 1 files changed, 6 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TabPaneSkin.java	Wed Oct 23 09:32:58 2013 +0200
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TabPaneSkin.java	Wed Oct 23 09:34:33 2013 +0200
@@ -1124,16 +1124,14 @@
                     final double closeBtnHeight = showCloseButton() ? snapSize(closeBtn.prefHeight(-1)) : 0;
                     final double minWidth = snapSize(skinnable.getTabMinWidth());
                     final double maxWidth = snapSize(skinnable.getTabMaxWidth());
-                    final double minHeight = snapSize(skinnable.getTabMinHeight());
                     final double maxHeight = snapSize(skinnable.getTabMaxHeight());
 
                     double labelAreaWidth = prefLabelWidth;
-                    double labelAreaHeight = prefLabelHeight;
                     double labelWidth = prefLabelWidth;
                     double labelHeight = prefLabelHeight;
                     
                     final double childrenWidth = labelAreaWidth + closeBtnWidth;
-                    final double childrenHeight = Math.max(labelAreaHeight, closeBtnHeight);
+                    final double childrenHeight = Math.max(labelHeight, closeBtnHeight);
                     
                     if (childrenWidth > maxWidth && maxWidth != Double.MAX_VALUE) {
                         labelAreaWidth = maxWidth - closeBtnWidth;
@@ -1143,10 +1141,7 @@
                     }
 
                     if (childrenHeight > maxHeight && maxHeight != Double.MAX_VALUE) {
-                        labelAreaHeight = maxHeight;
                         labelHeight = maxHeight;
-                    } else if (childrenHeight < minHeight) {
-                        labelAreaHeight = minHeight;
                     }
 
                     if (animating) {
@@ -1179,12 +1174,12 @@
                         positionInArea(closeBtn, closeBtnStartX, paddingTop, closeBtnWidth, h,
                                 /*baseline ignored*/0, HPos.CENTER, VPos.CENTER);
                     }
-                    
+
                     focusIndicator.resizeRelocate(
-                            label.getLayoutX() - padding, 
-                            Math.min(label.getLayoutY(), closeBtn.isVisible() ? closeBtn.getLayoutY() : Double.MAX_VALUE) - padding, 
-                            labelWidth + closeBtnWidth + padding * 2,
-                            Math.max(labelHeight, closeBtnHeight) + padding*2);
+                            paddingLeft - padding,
+                            paddingTop + padding,
+                            w + 2 * padding,
+                            h - 2 * padding);
                 }
             };
             inner.getStyleClass().add("tab-container");