File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1839,6 +1839,17 @@ public void handlePrefs() {
18391839 dialog .setVisible (true );
18401840 }
18411841
1842+ /**
1843+ * Adjust font size
1844+ */
1845+ public void handleFontSizeChange (int change ) {
1846+ String pieces [] = PApplet .split (PreferencesData .get ("editor.font" ), ',' );
1847+ int newSize = Integer .parseInt (pieces [2 ]) + change ;
1848+ pieces [2 ] = String .valueOf (newSize );
1849+ PreferencesData .set ("editor.font" , PApplet .join (pieces , ',' ));
1850+ this .getEditors ().forEach (processing .app .Editor ::applyPreferences );
1851+ }
1852+
18421853 // XXX: Remove this method and make librariesIndexer non-static
18431854 static public LibraryList getLibraries () {
18441855 return BaseNoGui .librariesIndexer .getInstalledLibraries ();
Original file line number Diff line number Diff line change @@ -1374,6 +1374,24 @@ public void actionPerformed(ActionEvent e) {
13741374
13751375 menu .addSeparator ();
13761376
1377+ JMenuItem increaseFontSizeItem = newJMenuItem (tr ("Increase Font Size" ), '=' );
1378+ increaseFontSizeItem .addActionListener (new ActionListener () {
1379+ public void actionPerformed (ActionEvent e ) {
1380+ base .handleFontSizeChange (1 );
1381+ }
1382+ });
1383+ menu .add (increaseFontSizeItem );
1384+
1385+ JMenuItem decreaseFontSizeItem = newJMenuItem (tr ("Decrease Font Size" ), '-' );
1386+ decreaseFontSizeItem .addActionListener (new ActionListener () {
1387+ public void actionPerformed (ActionEvent e ) {
1388+ base .handleFontSizeChange (-1 );
1389+ }
1390+ });
1391+ menu .add (decreaseFontSizeItem );
1392+
1393+ menu .addSeparator ();
1394+
13771395 JMenuItem findItem = newJMenuItem (tr ("Find..." ), 'F' );
13781396 findItem .addActionListener (new ActionListener () {
13791397 public void actionPerformed (ActionEvent e ) {
You can’t perform that action at this time.
0 commit comments