change layout of theme entries inside lib/

This commit is contained in:
Ben Fry
2022-05-21 18:26:42 -04:00
parent 1e7fdabf6e
commit adf7a401c4
38 changed files with 18 additions and 7 deletions
@@ -88,7 +88,8 @@ public class ThemeSelector extends JFrame implements Tool {
this.base = base;
try {
File themeFolder = Base.getLibFile("themes");
// File themeFolder = Base.getLibFile("theme");
File themeFolder = Theme.getThemeFolder();
File[] setFolders = themeFolder.listFiles(file -> {
if (file.isDirectory()) {
File orderFile = new File(file, ORDER_FILENAME);
@@ -221,7 +222,8 @@ public class ThemeSelector extends JFrame implements Tool {
public void run() {
// location for theme.txt in the sketchbook folder
// (doing this in run() in case the sketchbook location has changed)
sketchbookFile = new File(Base.getSketchbookFolder(), "theme.txt");
//sketchbookFile = new File(Base.getSketchbookFolder(), "theme.txt");
sketchbookFile = Theme.getSketchbookFile();
updateTheme();
+14 -5
View File
@@ -24,7 +24,6 @@ package processing.app.ui;
import processing.app.Base;
import processing.app.Messages;
import processing.app.Platform;
import processing.app.Settings;
import processing.app.syntax.SyntaxStyle;
import processing.core.PApplet;
@@ -43,10 +42,10 @@ public class Theme {
static public void init() {
try {
File inputFile = Platform.getContentFile("lib/theme.txt");
if (inputFile == null) {
throw new RuntimeException("Missing required file (theme.txt), you may need to reinstall.");
}
File inputFile = getThemeFile();
// if (inputFile == null) {
// throw new RuntimeException("Missing required file (theme.txt), you may need to reinstall.");
// }
// First load the default theme data for the whole PDE.
theme = new Settings(inputFile);
@@ -93,6 +92,16 @@ public class Theme {
}
static public File getThemeFolder() throws IOException {
return Base.getLibFile("theme");
}
static public File getThemeFile() throws IOException {
return new File(getThemeFolder(), "theme.txt");
}
static public File getSketchbookFile() {
return new File(Base.getSketchbookFolder(), "theme.txt");
}

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB