Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 08ef0a2

Browse files
Separate the boards menu per platform
Previously, the Tools->Boards menu was one long list, divided into different platforms by (unselectable) headers. When more than one or two platforms were installed, this quickly results in a very long list of boards that is hard to navigate. This commit changes the board menu to have a submenu for each platform, where each submenu contains just the boards for that platform. This fixes part of #8858.
1 parent b3dac78 commit 08ef0a2

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

‎app/src/processing/app/Base.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,23 +1469,18 @@ public void actionPerformed(ActionEvent actionevent) {
14691469
Map<String, ButtonGroup> buttonGroupsMap = new HashMap<>();
14701470

14711471
// Cycle through all packages
1472-
boolean first = true;
14731472
for (TargetPackage targetPackage : BaseNoGui.packages.values()) {
14741473
// For every package cycle through all platform
14751474
for (TargetPlatform targetPlatform : targetPackage.platforms()) {
14761475

1477-
// Add a separator from the previous platform
1478-
if (!first)
1479-
boardMenu.add(new JSeparator());
1480-
first = false;
1481-
14821476
// Add a title for each platform
14831477
String platformLabel = targetPlatform.getPreferences().get("name");
1484-
if (platformLabel != null && !targetPlatform.getBoards().isEmpty()) {
1485-
JMenuItem menuLabel = new JMenuItem(tr(platformLabel));
1486-
menuLabel.setEnabled(false);
1487-
boardMenu.add(menuLabel);
1488-
}
1478+
if (platformLabel == null)
1479+
platformLabel = targetPackage.getId() + "-" + targetPlatform.getId();
1480+
1481+
JMenu platformBoardsMenu = new JMenu(tr(platformLabel));
1482+
MenuScroller.setScrollerFor(platformBoardsMenu);
1483+
boardMenu.add(platformBoardsMenu);
14891484

14901485
// Cycle through all boards of this platform
14911486
for (TargetBoard board : targetPlatform.getBoards().values()) {
@@ -1494,7 +1489,7 @@ public void actionPerformed(ActionEvent actionevent) {
14941489
JMenuItem item = createBoardMenusAndCustomMenus(boardsCustomMenus, menuItemsToClickAfterStartup,
14951490
buttonGroupsMap,
14961491
board, targetPlatform, targetPackage);
1497-
boardMenu.add(item);
1492+
platformBoardsMenu.add(item);
14981493
boardsButtonGroup.add(item);
14991494
}
15001495
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /