changeset 1414:330911490952

RT-21684: TableView with hidden/invisible columns: resizing of columns gets confused
author jgiles
date Mon, 09 Jul 2012 10:12:06 +1200
parents b06e3fb7dd1a
children e3ddeb5fe157
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Wed Jul 04 07:37:04 2012 +1200
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Mon Jul 09 10:12:06 2012 +1200
@@ -209,6 +209,10 @@
             header.dispose();
         }
         
+        for (int i = 0; i < dragRects.size(); i++) {
+            Rectangle rect = dragRects.get(i);
+            rect.visibleProperty().unbind();
+        }
         dragRects.clear();
         getChildren().clear();
     }
@@ -348,7 +352,7 @@
             rect.setWidth(DRAG_RECT_WIDTH);
             rect.setHeight(getHeight() - label.getHeight());
             rect.setFill(Color.TRANSPARENT);
-            rect.setVisible(false);
+            rect.visibleProperty().bind(c.visibleProperty());
             rect.setSmooth(false);
             rect.setOnMousePressed(rectMousePressed);
             rect.setOnMouseDragged(rectMouseDragged);
@@ -439,7 +443,6 @@
             // position drag overlay to intercept column resize requests
             if (dragRects != null && i < dragRects.size()) {
                 Rectangle dragRect = dragRects.get(i++);
-                dragRect.setVisible(true);
                 dragRect.setHeight(getHeight() - label.getHeight());
                 dragRect.relocate(x - DRAG_RECT_WIDTH / 2, getInsets().getTop() + labelHeight);
             }