If you have a list view with wildly different cell heights, including some where a single cell fills the entire viewport, then as you scroll the thumb goes wild, sometimes being tiny, sometimes being very large. The thumb shouldn't change size ever, only the speed at which it travels when using pixel scrolling / up/down arrows.
Proposed Fix:
diff -r a84b7d37f507 javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java Mon Sep 17 15:44:47 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java Tue Sep 18 10:28:05 2012 -0700
@@ -26,19 +26,16 @@
package com.sun.javafx.scene.control.skin;
import java.util.ArrayList;
-
import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.BooleanPropertyBase;
-import javafx.beans.property.DoubleProperty;
-import javafx.beans.property.DoublePropertyBase;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.ObservableList;
import javafx.event.Event;
+import javafx.event.EventDispatchChain;
import javafx.event.EventDispatcher;
-import javafx.event.EventDispatchChain;
import javafx.event.EventHandler;
import javafx.geometry.Orientation;
import javafx.scene.Group;
@@ -52,7 +49,6 @@
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane;
import javafx.scene.shape.Rectangle;
-
import javafx.util.Callback;
/**
@@ -1313,12 +1309,13 @@
if (lengthBar.isVisible()) {
lengthBar.setMax(1);
-
- if (numCellsVisibleOnScreen == 0) {
- // special case to help resolveRT-17701
+
+ if (numCellsVisibleOnScreen == 0 && cellCount == 1) {
+ // special case to help resolveRT-17701 and the case where we have
+ // only a single row and it is bigger than the viewport
lengthBar.setVisibleAmount(flowLength / sumCellLength);
} else {
- lengthBar.setVisibleAmount(numCellsVisibleOnScreen / (float) cellCount);
+ lengthBar.setVisibleAmount(cellCount / viewportLength);
}
// Fix forRT-11873. If this isn't here, we can have a situation where
Proposed Fix:
diff -r a84b7d37f507 javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java Mon Sep 17 15:44:47 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/VirtualFlow.java Tue Sep 18 10:28:05 2012 -0700
@@ -26,19 +26,16 @@
package com.sun.javafx.scene.control.skin;
import java.util.ArrayList;
-
import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.BooleanPropertyBase;
-import javafx.beans.property.DoubleProperty;
-import javafx.beans.property.DoublePropertyBase;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.ObservableList;
import javafx.event.Event;
+import javafx.event.EventDispatchChain;
import javafx.event.EventDispatcher;
-import javafx.event.EventDispatchChain;
import javafx.event.EventHandler;
import javafx.geometry.Orientation;
import javafx.scene.Group;
@@ -52,7 +49,6 @@
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane;
import javafx.scene.shape.Rectangle;
-
import javafx.util.Callback;
/**
@@ -1313,12 +1309,13 @@
if (lengthBar.isVisible()) {
lengthBar.setMax(1);
-
- if (numCellsVisibleOnScreen == 0) {
- // special case to help resolve
+
+ if (numCellsVisibleOnScreen == 0 && cellCount == 1) {
+ // special case to help resolve
+ // only a single row and it is bigger than the viewport
lengthBar.setVisibleAmount(flowLength / sumCellLength);
} else {
- lengthBar.setVisibleAmount(numCellsVisibleOnScreen / (float) cellCount);
+ lengthBar.setVisibleAmount(cellCount / viewportLength);
}
// Fix for
- duplicates
-
JDK-8128174 [ListView] ScrollBar's knob changes its size during scrolling
-
- Closed
-
- relates to
-
JDK-8119066 Weird scrolling of customized ListView using mouse wheel
-
- Resolved
-
-
JDK-8088400 Scrolling of VirtualFlow with items of different cell-lenght has different speed depending on the current size.
-
- Open
-
-
JDK-8123358 Scroll bar thumb doesn't work on touch interface
-
- Closed
-