From 855e7d83540c694249b971b8318a22bb112ac8bc Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Fri, 2 Jul 2021 21:20:58 -0400 Subject: [PATCH] messing with dynamic update of prefs --- app/src/processing/app/ui/Editor.java | 2 +- .../ThemeEngine/src/processing/app/tools/ThemeEngine.java | 7 +++++++ java/src/processing/mode/java/JavaEditor.java | 2 +- todo.txt | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/processing/app/ui/Editor.java b/app/src/processing/app/ui/Editor.java index 7bbf95f09..a68ead7b9 100644 --- a/app/src/processing/app/ui/Editor.java +++ b/app/src/processing/app/ui/Editor.java @@ -663,7 +663,7 @@ public abstract class Editor extends JFrame implements RunnerListener { * the app is just starting up, or the user just finished messing * with things in the Preferences window. */ - protected void applyPreferences() { + public void applyPreferences() { // Update fonts and other items controllable from the prefs textarea.getPainter().updateAppearance(); textarea.repaint(); diff --git a/build/shared/tools/ThemeEngine/src/processing/app/tools/ThemeEngine.java b/build/shared/tools/ThemeEngine/src/processing/app/tools/ThemeEngine.java index 821017ffe..412999e5c 100644 --- a/build/shared/tools/ThemeEngine/src/processing/app/tools/ThemeEngine.java +++ b/build/shared/tools/ThemeEngine/src/processing/app/tools/ThemeEngine.java @@ -1,6 +1,8 @@ package processing.app.tools; import processing.app.Base; +import processing.app.Preferences; +import processing.app.ui.Editor; public class ThemeEngine implements Tool { @@ -19,5 +21,10 @@ public class ThemeEngine implements Tool { public void run() { //setVisible(true); + //Preferences.init(); + for (Editor editor : base.getEditors()) { + System.out.println("Updating settings for " + editor.getSketch().getName()); + editor.applyPreferences(); + } } } diff --git a/java/src/processing/mode/java/JavaEditor.java b/java/src/processing/mode/java/JavaEditor.java index ea6667628..5a8abe8c0 100644 --- a/java/src/processing/mode/java/JavaEditor.java +++ b/java/src/processing/mode/java/JavaEditor.java @@ -2316,7 +2316,7 @@ public class JavaEditor extends Editor { @Override - protected void applyPreferences() { + public void applyPreferences() { super.applyPreferences(); if (jmode != null) { diff --git a/todo.txt b/todo.txt index 32ba4b115..1958a2b4a 100755 --- a/todo.txt +++ b/todo.txt @@ -4,6 +4,7 @@ X should prevent conflicts, avoid papering over other bugs X remove the PDE classpath from sketches X causing it to include incomplete JFX, other misc; too confusing X add ui.font.family and ui.font.size as preferences +X Editor.applyPreferences() was protected, now public readme _ was fixed in the source for 4.0a5, but may not have been included in the dist