Skip to content

Commit c8c0361

Browse files
author
Federico Fissore
committed
Removed color theme selection: we currently support only one theme
1 parent 08b6c4e commit c8c0361

File tree

4 files changed

+10
-42
lines changed

4 files changed

+10
-42
lines changed

app/src/processing/app/Editor.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,7 @@ protected void applyPreferences() {
464464
saveAsMenuItem.setEnabled(!external);
465465

466466
scrollPane.setLineNumbersEnabled(Preferences.getBoolean("editor.linenumbers"));
467-
468-
textarea.setTheme(Preferences.get("editor.syntax_theme"));
469-
467+
470468
textarea.setCodeFoldingEnabled(Preferences.getBoolean("editor.code_folding"));
471469

472470
if (external) {
@@ -928,7 +926,7 @@ protected String findClassInZipFile(String base, File file) {
928926
}
929927

930928

931-
protected SketchTextArea createTextArea(){
929+
protected SketchTextArea createTextArea() throws IOException {
932930
SketchTextArea textArea = new SketchTextArea();
933931
textArea.requestFocusInWindow();
934932
textArea.setMarkOccurrences(true);

app/src/processing/app/Preferences.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ public String toString() {
231231
JCheckBox autoAssociateBox;
232232
JComboBox comboLanguage;
233233
JComboBox comboWarnings;
234-
JComboBox comboSyntaxThemes;
235234
JCheckBox saveVerifyUploadBox;
236235
JTextField proxyHTTPServer;
237236
JTextField proxyHTTPPort;
@@ -359,27 +358,6 @@ public void actionPerformed(ActionEvent e) {
359358
fontSizeField.setText(String.valueOf(editorFont.getSize()));
360359
top += d.height + GUI_BETWEEN;
361360

362-
// Syntax Coloring [ ]
363-
364-
box = Box.createHorizontalBox();
365-
label = new JLabel(_("Syntax Coloring: "));
366-
box.add(label);
367-
String[] syntaxThemes = new String[]{"default","dark"};
368-
comboSyntaxThemes = new JComboBox(syntaxThemes);
369-
String currentTheme = PreferencesData.get("editor.syntax_theme", "default");
370-
for (String item : syntaxThemes) {
371-
if (currentTheme.equals(item)) {
372-
comboSyntaxThemes.setSelectedItem(item);
373-
}
374-
}
375-
box.add(comboSyntaxThemes);
376-
pane.add(box);
377-
d = box.getPreferredSize();
378-
box.setForeground(Color.gray);
379-
box.setBounds(left, top, d.width, d.height);
380-
right = Math.max(right, left + d.width);
381-
top += d.height + GUI_BETWEEN;
382-
383361
// Show verbose output during: [ ] compilation [ ] upload
384362

385363
box = Box.createHorizontalBox();
@@ -765,7 +743,6 @@ protected void applyFrame() {
765743
PreferencesData.set("sketchbook.path", newPath);
766744
}
767745

768-
PreferencesData.set("editor.syntax_theme", comboSyntaxThemes.getSelectedItem().toString());
769746
PreferencesData.setBoolean("editor.external", externalEditorBox.isSelected());
770747
PreferencesData.setBoolean("update.check", checkUpdatesBox.isSelected());
771748
PreferencesData.setBoolean("editor.save_on_verify", saveVerifyUploadBox.isSelected());

app/src/processing/app/syntax/SketchTextArea.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,31 +75,27 @@ public class SketchTextArea extends RSyntaxTextArea {
7575

7676
private EditorListener editorListener;
7777

78-
public SketchTextArea() {
78+
public SketchTextArea() throws IOException {
7979
super();
8080
installFeatures();
8181
}
8282

8383

84-
protected void installFeatures(){
84+
protected void installFeatures() throws IOException {
8585

8686
setTheme(Preferences.get("editor.syntax_theme", "default"));
87-
87+
8888
setLinkGenerator(new DocLinkGenerator());
8989

9090
fixControlTab();
9191
installTokenMaker();
9292
}
93-
94-
public void setTheme(String name){
95-
try {
96-
Theme theme = Theme.load(Base.getLibStream("theme/syntax/"+name+".xml"));
97-
theme.apply(this);
98-
} catch (IOException e) {
99-
e.printStackTrace();
100-
}
93+
94+
public void setTheme(String name) throws IOException {
95+
Theme theme = Theme.load(Base.getLibStream("theme/syntax/" + name + ".xml"));
96+
theme.apply(this);
10197
}
102-
98+
10399
// Removing the default focus traversal keys
104100
// This is because the DefaultKeyboardFocusManager handles the keypress and consumes the event
105101
protected void fixControlTab(){

build/shared/lib/preferences.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ editor.window.height.min = 290
8686
# tested to be 515 on Windows XP, this leaves some room
8787
#editor.window.height.min.windows = 530
8888

89-
# Syntax coloring ( on lib/theme/syntax )
90-
editor.syntax_theme=default
91-
9289
# Enable code folding
9390
editor.code_folding=true
9491

0 commit comments

Comments
 (0)