1
0
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:
ricardo.jl.rufino 2015-04-23 14:08:33 -03:00 committed by Federico Fissore
parent 1e61cd6b4c
commit f426188d04
3 changed files with 21 additions and 3 deletions

View File

@ -452,6 +452,10 @@ public class Editor extends JFrame implements RunnerListener {
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
Color color = Theme.getColor("editor.external.bgcolor");
@ -480,7 +484,6 @@ public class Editor extends JFrame implements RunnerListener {
// For 0126, moved into Base, which will notify all editors.
//base.rebuildMenusAsync();
textarea.setTheme(Preferences.get("editor.syntax_theme"));
}

View File

@ -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.

View File

@ -89,6 +89,9 @@ editor.window.height.min = 290
# Syntax coloring ( on lib/theme/syntax )
editor.syntax_theme=default
# Enable code folding
editor.code_folding=true
# font size for editor
editor.font=Monospaced,plain,12
# Monaco is nicer on Mac OS X, so use that explicitly