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

ScrollPane : No way to know if a scroll bar is visible

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 7-pool
    • javafx

      It should be very helpful to know if a scroll bar within a scroll pane is visible or not.
      In my case, I want to add 1 pixel gap between the scroll pane content and the scroll bar (See attached screen shot).
      To do this, I need to dynamically add/remove css rules :

      .scrollBarVisible {
          /* Add 1 pixel gap between the ScrollPane content and the ScrollPane scroll bar when the scroll bar is visible */
          -fx-padding: 0 1 0 0;
      }

      .scrollBarNotVisible {
          /* Remove 1 pixel gap between the ScrollPane content and the ScrollPane scroll bar when the scroll bar is _not_ visible */
          -fx-padding: 0;
      }

      A pseudo-calss would allow something like :
      .scroll-bar {
          -fx-padding: 0;
      }
      .scroll-bar:visible {
          -fx-padding: 0 1 0 0;
      }

            Unassigned Unassigned
            slions Sandra Lions-piron
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported: