changeset 5887:c3867686aaa4

RT-34575: Ensemble8 does not work with a touch screen. Pushing on behalf of Martin Sladecek Reviewed-by: Rafi Tayar, jgiles
author jgiles
date Wed, 04 Dec 2013 07:53:42 +1300
parents 9d4bcbe21a6f
children 5f608d7df7a5
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java	Tue Dec 03 09:37:02 2013 -0800
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/VirtualFlow.java	Wed Dec 04 07:53:42 2013 +1300
@@ -930,7 +930,7 @@
         boolean cellNeedsLayout = false;
 
         if (BehaviorSkinBase.IS_TOUCH_SUPPORTED) {
-            if ((tempVisibility == true && (hbar.isVisible() == false || vbar.isVisible() == false)) ||
+            if ((tempVisibility == true && (needBreadthBar && hbar.isVisible() == false || needLengthBar && vbar.isVisible() == false)) ||
                 (tempVisibility == false && (hbar.isVisible() == true || vbar.isVisible() == true))) {
                 cellNeedsLayout = true;
             }
@@ -1321,8 +1321,8 @@
         // we need the breadth bar and the length bar.
         // The last condition here (viewportLength >= getHeight()) was added to
         // resolve the edge-case identified in RT-14350.
-        boolean needLengthBar = getPosition() > 0 && (cellCount >= cells.size() || viewportLength >= height);
-        boolean needBreadthBar = maxPrefBreadth > viewportBreadth || (needLengthBar && maxPrefBreadth > (viewportBreadth - lengthBarBreadth));
+        needLengthBar = getPosition() > 0 && (cellCount >= cells.size() || viewportLength >= height);
+        needBreadthBar = maxPrefBreadth > viewportBreadth || (needLengthBar && maxPrefBreadth > (viewportBreadth - lengthBarBreadth));
 
         // Start by optimistically deciding whether the length bar and
         // breadth bar are needed and adjust the viewport dimensions
@@ -2108,7 +2108,7 @@
         if (delta == 0) return 0;
 
         final boolean isVertical = isVertical();
-        if ((isVertical && ! vbar.isVisible()) || (! isVertical && ! hbar.isVisible())) return 0;
+        if (!tempVisibility && ((isVertical && ! vbar.isVisible()) || (! isVertical && ! hbar.isVisible()))) return 0;
         
         double pos = getPosition();
         if (pos == 0.0f && delta < 0) return 0;
@@ -2634,6 +2634,8 @@
     KeyFrame sbTouchKF1;
     KeyFrame sbTouchKF2;
 
+    private boolean needBreadthBar;
+    private boolean needLengthBar;
     private boolean tempVisibility = false;
 
     protected void startSBReleasedAnimation() {