changeset 6471:bdfad1c1aebe

RT-36140 [TableView, Cursor] Mouse flickers when resizing a table column Reviewed by: jgiles
author Martin Sladecek <martin.sladecek@oracle.com>
date Thu, 13 Mar 2014 08:41:34 +0100
parents f1194ad7a283
children 4b447b1a4130
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Wed Mar 12 16:55:56 2014 -0700
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/NestedTableColumnHeader.java	Thu Mar 13 08:41:34 2014 +0100
@@ -194,8 +194,10 @@
             TableColumnBase column = (TableColumnBase) rect.getProperties().get(TABLE_COLUMN_KEY);
             NestedTableColumnHeader header = (NestedTableColumnHeader) rect.getProperties().get(TABLE_COLUMN_HEADER_KEY);
 
-            rect.setCursor(header.isColumnResizingEnabled() && rect.isHover() &&
-                    column.isResizable() ? Cursor.H_RESIZE : Cursor.DEFAULT);
+            if (header.getCursor() == null) { // If there's a cursor for the whole header, don't override it
+                rect.setCursor(header.isColumnResizingEnabled() && rect.isHover() &&
+                        column.isResizable() ? Cursor.H_RESIZE : null);
+            }
         }
     };
     
@@ -545,6 +547,7 @@
     }
 
     private void columnResizingStarted(double startX) {
+        setCursor(Cursor.H_RESIZE);
         columnReorderLine.setLayoutX(startX);
     }
 
@@ -561,7 +564,7 @@
     }
 
     private void columnResizingComplete(TableColumnBase col, MouseEvent me) {
-//        getTableHeaderRow().getColumnReorderLine().setVisible(true);
+        setCursor(null);
         columnReorderLine.setTranslateX(0.0F);
         columnReorderLine.setLayoutX(0.0F);
         lastX = 0.0F;