mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
change layout of theme entries inside lib/
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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 |
Reference in New Issue
Block a user