File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -1200,21 +1200,36 @@ public void rebuildExamplesMenu(JMenu menu) {
12001200 menu .removeAll ();
12011201
12021202 // Add examples from distribution "example" folder
1203+ JMenuItem label = new JMenuItem (tr ("Built-in Examples" ));
1204+ label .setEnabled (false );
1205+ menu .add (label );
12031206 boolean found = addSketches (menu , BaseNoGui .getExamplesFolder ());
1204- if (found ) menu .addSeparator ();
1207+ if (found ) {
1208+ menu .addSeparator ();
1209+ }
12051210
12061211 // Add examples from libraries
12071212 LibraryList ideLibs = getIDELibs ();
12081213 ideLibs .sort ();
1209- for (UserLibrary lib : ideLibs )
1214+ if (!ideLibs .isEmpty ()) {
1215+ label = new JMenuItem (tr ("Examples from Libraries" ));
1216+ label .setEnabled (false );
1217+ menu .add (label );
1218+ }
1219+ for (UserLibrary lib : ideLibs ) {
12101220 addSketchesSubmenu (menu , lib );
1221+ }
12111222
12121223 LibraryList userLibs = getUserLibs ();
12131224 if (userLibs .size () > 0 ) {
12141225 menu .addSeparator ();
12151226 userLibs .sort ();
1216- for (UserLibrary lib : userLibs )
1227+ label = new JMenuItem (tr ("Examples from Custom Libraries" ));
1228+ label .setEnabled (false );
1229+ menu .add (label );
1230+ for (UserLibrary lib : userLibs ) {
12171231 addSketchesSubmenu (menu , lib );
1232+ }
12181233 }
12191234 }
12201235
You can’t perform that action at this time.
0 commit comments