mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
Add 'Code Folding' preferences and fix Font-Size changes
This commit is contained in:
parent
1e61cd6b4c
commit
f426188d04
@ -451,6 +451,10 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
saveAsMenuItem.setEnabled(!external);
|
||||
|
||||
scrollPane.setLineNumbersEnabled(PreferencesData.getBoolean("editor.linenumbers"));
|
||||
|
||||
textarea.setTheme(PreferencesData.get("editor.syntax_theme"));
|
||||
|
||||
textarea.setCodeFoldingEnabled(PreferencesData.getBoolean("editor.code_folding"));
|
||||
|
||||
if (external) {
|
||||
// disable line highlight and turn off the caret when disabling
|
||||
@ -479,8 +483,7 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
//sketchbook.rebuildMenus();
|
||||
// For 0126, moved into Base, which will notify all editors.
|
||||
//base.rebuildMenusAsync();
|
||||
|
||||
textarea.setTheme(Preferences.get("editor.syntax_theme"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -222,6 +222,7 @@ public class Preferences {
|
||||
JCheckBox verboseCompilationBox;
|
||||
JCheckBox verboseUploadBox;
|
||||
JCheckBox displayLineNumbersBox;
|
||||
JCheckBox enableCodeFoldingBox;
|
||||
JCheckBox verifyUploadBox;
|
||||
JCheckBox externalEditorBox;
|
||||
JCheckBox checkUpdatesBox;
|
||||
@ -423,6 +424,15 @@ public class Preferences {
|
||||
right = Math.max(right, left + d.width);
|
||||
top += d.height + GUI_BETWEEN;
|
||||
|
||||
// [ ] Enable Code Folding
|
||||
|
||||
enableCodeFoldingBox = new JCheckBox(_("Enable Code Folding"));
|
||||
pane.add(enableCodeFoldingBox);
|
||||
d = enableCodeFoldingBox.getPreferredSize();
|
||||
enableCodeFoldingBox.setBounds(left, top, d.width + 10, d.height);
|
||||
right = Math.max(right, left + d.width);
|
||||
top += d.height + GUI_BETWEEN;
|
||||
|
||||
// [ ] Verify code after upload
|
||||
|
||||
verifyUploadBox = new JCheckBox(_("Verify code after upload"));
|
||||
@ -745,6 +755,7 @@ public class Preferences {
|
||||
PreferencesData.setBoolean("build.verbose", verboseCompilationBox.isSelected());
|
||||
PreferencesData.setBoolean("upload.verbose", verboseUploadBox.isSelected());
|
||||
PreferencesData.setBoolean("editor.linenumbers", displayLineNumbersBox.isSelected());
|
||||
PreferencesData.setBoolean("editor.code_folding", enableCodeFoldingBox.isSelected());
|
||||
PreferencesData.setBoolean("upload.verify", verifyUploadBox.isSelected());
|
||||
PreferencesData.setBoolean("editor.save_on_verify", saveVerifyUploadBox.isSelected());
|
||||
|
||||
@ -836,6 +847,7 @@ public class Preferences {
|
||||
verboseCompilationBox.setSelected(PreferencesData.getBoolean("build.verbose"));
|
||||
verboseUploadBox.setSelected(PreferencesData.getBoolean("upload.verbose"));
|
||||
displayLineNumbersBox.setSelected(PreferencesData.getBoolean("editor.linenumbers"));
|
||||
enableCodeFoldingBox.setSelected(PreferencesData.getBoolean("editor.code_folding"));
|
||||
verifyUploadBox.setSelected(PreferencesData.getBoolean("upload.verify"));
|
||||
|
||||
//closingLastQuitsBox.
|
||||
|
@ -87,7 +87,10 @@ editor.window.height.min = 290
|
||||
#editor.window.height.min.windows = 530
|
||||
|
||||
# Syntax coloring ( on lib/theme/syntax )
|
||||
editor.syntax_theme = default
|
||||
editor.syntax_theme=default
|
||||
|
||||
# Enable code folding
|
||||
editor.code_folding=true
|
||||
|
||||
# font size for editor
|
||||
editor.font=Monospaced,plain,12
|
||||
|
Loading…
Reference in New Issue
Block a user