File tree 2 files changed +29
-0
lines changed
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1839,6 +1839,17 @@ public void handlePrefs() {
1839
1839
dialog .setVisible (true );
1840
1840
}
1841
1841
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
+
1842
1853
// XXX: Remove this method and make librariesIndexer non-static
1843
1854
static public LibraryList getLibraries () {
1844
1855
return BaseNoGui .librariesIndexer .getInstalledLibraries ();
Original file line number Diff line number Diff line change @@ -1374,6 +1374,24 @@ public void actionPerformed(ActionEvent e) {
1374
1374
1375
1375
menu .addSeparator ();
1376
1376
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
+
1377
1395
JMenuItem findItem = newJMenuItem (tr ("Find..." ), 'F' );
1378
1396
findItem .addActionListener (new ActionListener () {
1379
1397
public void actionPerformed (ActionEvent e ) {
You can’t perform that action at this time.
0 commit comments