Browse Source

Prevent scrollbar from glowing when reached either end of the

scrollbar.
pull/1/head
weisj 5 years ago
parent
commit
834655af11
  1. 7
      src/main/java/com/weis/darklaf/ui/scrollpane/DarkScrollBarUI.java

7
src/main/java/com/weis/darklaf/ui/scrollpane/DarkScrollBarUI.java

@ -83,9 +83,14 @@ public class DarkScrollBarUI extends BasicScrollBarUI {
private Animator thumbFadeinAnimator;
private final AdjustmentListener adjustmentListener = new AdjustmentListener() {
@Override
public void adjustmentValueChanged(final AdjustmentEvent e) {
public void adjustmentValueChanged(@NotNull final AdjustmentEvent e) {
if (!e.getValueIsAdjusting()) return;
JScrollBar scrollBar = (JScrollBar) e.getAdjustable();
int extent = scrollBar.getModel().getExtent();
int value = scrollBar.getValue() + extent;
if (value == extent || value == scrollBar.getMaximum()) return;
var p = MouseInfo.getPointerInfo().getLocation();
SwingUtilities.convertPointFromScreen(p, scrollbar);
if (!getThumbBounds().contains(p)) {

Loading…
Cancel
Save