mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-149395 ignore splitter on glass pane if mouse above scroll thumb
This commit is contained in:
@@ -103,6 +103,14 @@ class DefaultScrollBarUI extends ScrollBarUI {
|
||||
return Registry.is("ide.scroll.bar.expand.animation");
|
||||
}
|
||||
|
||||
boolean isTrackContains(int x, int y) {
|
||||
return myTrackBounds.contains(x, y);
|
||||
}
|
||||
|
||||
boolean isThumbContains(int x, int y) {
|
||||
return myThumbBounds.contains(x, y);
|
||||
}
|
||||
|
||||
void onTrackHover(boolean hover) {
|
||||
myTrackAnimator.start(hover);
|
||||
}
|
||||
@@ -356,9 +364,9 @@ class DefaultScrollBarUI extends ScrollBarUI {
|
||||
private boolean isOverThumb;
|
||||
|
||||
private void updateMouse(int x, int y) {
|
||||
if (myTrackBounds.contains(x, y)) {
|
||||
if (isTrackContains(x, y)) {
|
||||
if (!isOverTrack) onTrackHover(isOverTrack = true);
|
||||
boolean hover = myThumbBounds.contains(x, y);
|
||||
boolean hover = isThumbContains(x, y);
|
||||
if (isOverThumb != hover) onThumbHover(isOverThumb = hover);
|
||||
}
|
||||
else {
|
||||
@@ -397,12 +405,12 @@ class DefaultScrollBarUI extends ScrollBarUI {
|
||||
myMouseY = event.getY();
|
||||
|
||||
boolean vertical = VERTICAL == myScrollBar.getOrientation();
|
||||
if (myThumbBounds.contains(myMouseX, myMouseY)) {
|
||||
if (isThumbContains(myMouseX, myMouseY)) {
|
||||
// pressed on the thumb
|
||||
myOffset = vertical ? (myMouseY - myThumbBounds.y) : (myMouseX - myThumbBounds.x);
|
||||
isDragging = true;
|
||||
}
|
||||
else if (myTrackBounds.contains(myMouseX, myMouseY)) {
|
||||
else if (isTrackContains(myMouseX, myMouseY)) {
|
||||
// pressed on the track
|
||||
if (isAbsolutePositioning(event)) {
|
||||
myOffset = (vertical ? myThumbBounds.height : myThumbBounds.width) / 2;
|
||||
|
||||
@@ -352,6 +352,12 @@ public class JBScrollPane extends JScrollPane {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (ui instanceof DefaultScrollBarUI) {
|
||||
DefaultScrollBarUI dui = (DefaultScrollBarUI)ui;
|
||||
Point point = e.getLocationOnScreen();
|
||||
SwingUtilities.convertPointFromScreen(point, bar);
|
||||
return !dui.isThumbContains(point.x, point.y);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user