Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8332041

Scrollbar Click jumps inconsistent amount of pixels

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • jfx23
    • javafx
    • None
    • source, behavioral
    • minimal
    • Hide
      The source compat risk for adding the new method is just the usual minimal risk of adding any new API since it might clash if a subclass has a method of the same name; the behavioral compatibility, which is also minimal, is that some users might notice that clicking in the scroll bar trough doesn't go to the same place it used to
      Show
      The source compat risk for adding the new method is just the usual minimal risk of adding any new API since it might clash if a subclass has a method of the same name; the behavioral compatibility, which is also minimal, is that some users might notice that clicking in the scroll bar trough doesn't go to the same place it used to
    • Java API, Other
    • JDK

      Summary

      Add the method double VirtualFlow.getViewportLength().

      Problem

      The ViewportLength can be used by controls interacting with the VirtualFlow, like the ScrollBars. Without this API, it's not possible to access the exact viewport of the VirtualFlow.

      Solution

      We make the previously existing method getViewportLength public.

      We also slightly change the behavior. The scroll behavior when clicking on the scrollbar track is changed. Now it is scrolled by viewport length instead of the length of the empty cell. Furthermore, the alignment of the cells to the view top respectively bottom is no longer executed.

      Specification

      public double VirtualFlow.getViewportLength(), based on the javadoc:

      /**
       * Returns the length of the viewport portion of the {@code VirtualFlow} as computed during the layout pass.
       * For a vertical flow this is based on the height and for a horizontal flow on the width of the clip view.
       *
       * @return the viewport length in pixels
       * @since 23
       */

      Clicking in the scrollbar trough will now use the value of the new method to decide how much to scroll.

            fkirmaier Florian Kirmaier
            fkirmaier Florian Kirmaier
            Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: