changeset 5487:fbccbf6e7e8a

RT-27897 : [Touch] ScrollBars should stay visible when users touch the screen, reviewed by David
author mickf
date Tue, 22 Oct 2013 17:23:04 +0100
parents 87a605e50354
children 50cde3719e4d
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Tue Oct 22 17:20:59 2013 +0100
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ScrollPaneSkin.java	Tue Oct 22 17:23:04 2013 +0100
@@ -327,10 +327,10 @@
 
         viewRect.setOnMousePressed(new EventHandler<javafx.scene.input.MouseEvent>() {
            @Override public void handle(javafx.scene.input.MouseEvent e) {
+               mouseDown = true;
                if (IS_TOUCH_SUPPORTED) {
                    startSBReleasedAnimation();
                }
-               mouseDown = true;
                pressX = e.getX();
                pressY = e.getY();
                ohvalue = hsb.getValue();
@@ -360,11 +360,7 @@
 
         viewRect.addEventFilter(MouseEvent.MOUSE_RELEASED, new EventHandler<MouseEvent>() {
             @Override public void handle(MouseEvent e) {
-                  if (IS_TOUCH_SUPPORTED) {
-                    startSBReleasedAnimation();
-                 }
                  mouseDown = false;
-
                  if (dragDetected == true) {
                      if (saveCursor != null) {
                          getSkinnable().setCursor(saveCursor);
@@ -583,7 +579,6 @@
         getSkinnable().setOnTouchReleased(new EventHandler<TouchEvent>() {
             @Override public void handle(TouchEvent e) {
                 touchDetected = false;
-                startSBReleasedAnimation();
                 e.consume();
             }
         });
@@ -1085,6 +1080,9 @@
             sbTouchKF1 = new KeyFrame(Duration.millis(0), new EventHandler<ActionEvent>() {
                 @Override public void handle(ActionEvent event) {
                     tempVisibility = true;
+                    if (touchDetected == true || mouseDown == true) {
+                        sbTouchTimeline.playFromStart();
+                    }
                 }
             });