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
@@ -814,6 +815,18 @@ protected JMenu buildEditMenu() {
814
815
item .addActionListener (e -> handleIndentOutdent (false ));
815
816
menu .add (item );
816
817
818
+ item = Toolkit .newJMenuItemExt ("menu.edit.increase_font" );
819
+ item .addActionListener (e -> {
820
+ modifyFontSize (true );
821
+ });
822
+ menu .add (item );
823
+
824
+ item = Toolkit .newJMenuItemExt ("menu.edit.decrease_font" );
825
+ item .addActionListener (e -> {
826
+ modifyFontSize (false );
827
+ });
828
+ menu .add (item );
829
+
817
830
menu .addSeparator ();
818
831
819
832
item = Toolkit .newJMenuItem (Language .text ("menu.edit.find" ), 'F' );
@@ -871,6 +884,16 @@ public void menuSelected(MenuEvent e) {
871
884
return menu ;
872
885
}
873
886
887
+ protected void modifyFontSize (boolean increase ){
888
+ var fontSize = Preferences .getInteger ("editor.font.size" );
889
+ fontSize += increase ? 1 : -1 ;
890
+ fontSize = Math .max (5 , Math .min (72 , fontSize ));
891
+ Preferences .setInteger ("editor.font.size" , fontSize );
892
+ for (Editor editor : base .getEditors ()) {
893
+ editor .applyPreferences ();
894
+ }
895
+ Preferences .save ();
896
+ }
874
897
875
898
abstract public JMenu buildSketchMenu ();
876
899
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