changeset 6539:da21a84618ee

RT-36139 [TableColumn] Inconsistent behaviour when resizing the last nested column on the right Reviewed by: jgiles
author Martin Sladecek <martin.sladecek@oracle.com>
date Mon, 24 Mar 2014 08:32:38 +0100
parents 6c7047fd93f0
children 12c8e820eb46
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Fri Mar 21 17:15:41 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Mon Mar 24 08:32:38 2014 +0100
@@ -377,12 +377,17 @@
             // position drag overlay to intercept column resize requests
             Rectangle dragRect = dragRects.get(n.getTableColumn());
             if (dragRect != null) {
-                dragRect.setHeight(getHeight() - label.getHeight());
+                dragRect.setHeight(n.getDragRectHeight());
                 dragRect.relocate(x - DRAG_RECT_WIDTH / 2, snappedTopInset() + labelHeight);
             }
         }
     }
 
+    @Override
+    double getDragRectHeight() {
+        return label.prefHeight(-1);
+    }
+
     // sum up all children columns
     @Override protected double computePrefWidth(double height) {
         checkState();
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Fri Mar 21 17:15:41 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Mon Mar 24 08:32:38 2014 +0100
@@ -953,6 +953,10 @@
     private static final PseudoClass PSEUDO_CLASS_LAST_VISIBLE = 
             PseudoClass.getPseudoClass("last-visible");
 
+    double getDragRectHeight() {
+        return getHeight();
+    }
+
     /**
       * Super-lazy instantiation pattern from Bill Pugh.
       * @treatAsPrivate implementation detail