File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
app/src/processing/app/ui
build/shared/lib/languages Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -372,6 +372,7 @@ public void actionPerformed(ActionEvent e) {
372
372
}
373
373
});
374
374
}
375
+
375
376
}
376
377
377
378
@@ -812,6 +813,18 @@ protected JMenu buildEditMenu() {
812
813
item .addActionListener (e -> handleIndentOutdent (false ));
813
814
menu .add (item );
814
815
816
+ item = Toolkit .newJMenuItemExt ("menu.edit.increase_font" );
817
+ item .addActionListener (e -> {
818
+ modifyFontSize (true );
819
+ });
820
+ menu .add (item );
821
+
822
+ item = Toolkit .newJMenuItemExt ("menu.edit.decrease_font" );
823
+ item .addActionListener (e -> {
824
+ modifyFontSize (false );
825
+ });
826
+ menu .add (item );
827
+
815
828
menu .addSeparator ();
816
829
817
830
item = Toolkit .newJMenuItem (Language .text ("menu.edit.find" ), 'F' );
@@ -869,6 +882,16 @@ public void menuSelected(MenuEvent e) {
869
882
return menu ;
870
883
}
871
884
885
+ protected void modifyFontSize (boolean increase ){
886
+ var fontSize = Preferences .getInteger ("editor.font.size" );
887
+ fontSize += increase ? 1 : -1 ;
888
+ fontSize = Math .max (5 , Math .min (72 , fontSize ));
889
+ Preferences .setInteger ("editor.font.size" , fontSize );
890
+ for (Editor editor : base .getEditors ()) {
891
+ editor .applyPreferences ();
892
+ }
893
+ Preferences .save ();
894
+ }
872
895
873
896
abstract public JMenu buildSketchMenu ();
874
897
Original file line number Diff line number Diff line change @@ -59,6 +59,14 @@ menu.edit.decrease_indent = ← Decrease Indent
59
59
menu.edit.decrease_indent.keystroke.macos = meta pressed OPEN_BRACKET
60
60
menu.edit.decrease_indent.keystroke.windows = ctrl pressed OPEN_BRACKET
61
61
menu.edit.decrease_indent.keystroke.linux = ctrl pressed OPEN_BRACKET
62
+ menu.edit.increase_font = Increase Font Size
63
+ menu.edit.increase_font.keystroke.macos = meta pressed EQUALS
64
+ menu.edit.increase_font.keystroke.windows = ctrl pressed EQUALS
65
+ menu.edit.increase_font.keystroke.linux = ctrl pressed EQUALS
66
+ menu.edit.decrease_font = Decrease Font Size
67
+ menu.edit.decrease_font.keystroke.macos = meta pressed MINUS
68
+ menu.edit.decrease_font.keystroke.windows = ctrl pressed MINUS
69
+ menu.edit.decrease_font.keystroke.linux = ctrl pressed MINUS
62
70
menu.edit.find = Find...
63
71
menu.edit.find_next = Find Next
64
72
menu.edit.find_previous = Find Previous
You can’t perform that action at this time.
0 commit comments