mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-29 18:52:13 +01:00
Mouse scroll wheel fix for MenuScroller
This commit is contained in:
parent
1877703920
commit
4a47eef28a
@ -470,9 +470,18 @@ public class MenuScroller {
|
||||
}
|
||||
|
||||
private void refreshMenu() {
|
||||
if (menuItems != null && menuItems.length > 0) {
|
||||
firstIndex = Math.max(topFixedCount, firstIndex);
|
||||
firstIndex = Math.min(menuItems.length - bottomFixedCount - scrollCount, firstIndex);
|
||||
if (menuItems == null || menuItems.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
int newFirstIndex = Math.max(topFixedCount, firstIndex);
|
||||
newFirstIndex = Math.min(menuItems.length - bottomFixedCount - scrollCount, newFirstIndex);
|
||||
|
||||
if (newFirstIndex < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
firstIndex = newFirstIndex;
|
||||
|
||||
upItem.setEnabled(firstIndex > topFixedCount);
|
||||
downItem.setEnabled(firstIndex + scrollCount < menuItems.length - bottomFixedCount);
|
||||
@ -502,7 +511,6 @@ public class MenuScroller {
|
||||
parent.revalidate();
|
||||
parent.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
private class MouseScrollListener implements MouseWheelListener {
|
||||
public void mouseWheelMoved(MouseWheelEvent mwe) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user