Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,7 @@ public void actionPerformed(ActionEvent actionevent) {
customMenu.putClientProperty("platform", getPlatformUniqueId(targetPlatform));
customMenu.putClientProperty("removeOnWindowDeactivation", true);
boardsCustomMenus.add(customMenu);
MenuScroller.setScrollerFor(customMenu);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/processing/app/tools/MenuScroller.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.awt.event.KeyEvent;
import java.util.Arrays;

/**
* A class that provides scrolling capabilities to a long menu dropdown or
Expand Down Expand Up @@ -539,7 +540,7 @@ public void popupMenuCanceled(PopupMenuEvent e) {
}

private void setMenuItems() {
menuItems = menu.getComponents();
menuItems = Arrays.stream(menu.getComponents()).filter(x -> x.isVisible()).toArray(Component[]::new);
if (keepVisibleIndex >= topFixedCount
&& keepVisibleIndex <= menuItems.length - bottomFixedCount
&& (keepVisibleIndex > firstIndex + scrollCount
Expand Down