mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
working on how to debug theme.txt changes
This commit is contained in:
@@ -2,6 +2,9 @@ package processing.app.tools;
|
||||
|
||||
import processing.app.Base;
|
||||
import processing.app.ui.Editor;
|
||||
import processing.app.ui.Theme;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
public class ThemeEngine implements Tool {
|
||||
@@ -19,13 +22,32 @@ public class ThemeEngine implements Tool {
|
||||
|
||||
|
||||
public void run() {
|
||||
//setVisible(true);
|
||||
//Preferences.init();
|
||||
Editor activeEditor = base.getActiveEditor();
|
||||
|
||||
for (Editor editor : base.getEditors()) {
|
||||
System.out.println("Updating theme for " + editor.getSketch().getName());
|
||||
//editor.applyPreferences();
|
||||
editor.updateTheme();
|
||||
File sketchbookFile = Theme.getSketchbookFile();
|
||||
if (!sketchbookFile.exists()) {
|
||||
// When first called, just create the theme.txt file
|
||||
Theme.save();
|
||||
|
||||
if (activeEditor != null) {
|
||||
activeEditor.statusNotice("Saved theme.txt to " + sketchbookFile);
|
||||
}
|
||||
|
||||
} else {
|
||||
// Normally, just reset the theme by loading theme.txt
|
||||
//setVisible(true);
|
||||
//Preferences.init();
|
||||
Theme.load();
|
||||
|
||||
for (Editor editor : base.getEditors()) {
|
||||
System.out.println("Updating theme for " + editor.getSketch().getName());
|
||||
//editor.applyPreferences();
|
||||
editor.updateTheme();
|
||||
}
|
||||
|
||||
if (activeEditor != null) {
|
||||
activeEditor.statusNotice("Finished updating theme.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user