changeset 1429:153fdd6ebb3d

RT-23198: TabPane menu is shown when not necessary.
author Kinsley Wong
date Tue, 10 Jul 2012 13:55:11 -0700
parents b26dbc994eec
children a0ca6475993a
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TabPaneSkin.java
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TabPaneSkin.java	Tue Jul 10 13:53:18 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TabPaneSkin.java	Tue Jul 10 13:55:11 2012 -0700
@@ -535,10 +535,8 @@
 
                 @Override protected void layoutChildren() {
                     if (tabsFit()) {
-                        controlButtons.showTabsMenu(false);
                         setScrollOffset(0.0);
                     } else {
-                        controlButtons.showTabsMenu(true);
                         if (!removeTab.isEmpty()) {                            
                             double offset = 0;
                             double w = tabHeaderArea.getWidth() - snapSize(controlButtons.prefWidth(-1)) - firstTabIndent() - SPACER;
@@ -811,7 +809,13 @@
             double tabBackgroundHeight = snapSize(prefHeight(-1));
             double headersPrefWidth = snapSize(headersRegion.prefWidth(-1));
             double headersPrefHeight = snapSize(headersRegion.prefHeight(-1));
-
+            
+            if (tabsFit()) {
+                controlButtons.showTabsMenu(false);
+            } else {
+                controlButtons.showTabsMenu(true);
+            }
+            
             updateHeaderClip();
 
             // RESIZE CONTROL BUTTONS
@@ -826,7 +830,7 @@
                 headerBackground.resize(snapSize(getWidth()), snapSize(getHeight()));
                 headerBackground.setVisible(true);
             }
-
+            
             double startX = 0;
             double startY = 0;
             double controlStartX = 0;