Skip to content

Commit

Permalink
custom themes
Browse files Browse the repository at this point in the history
  • Loading branch information
cubewhy committed Jan 13, 2024
1 parent 4b28404 commit efdb668
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/main/java/org/cubewhy/celestial/gui/pages/GuiSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@
import java.awt.event.FocusEvent;
import java.io.File;
import java.text.DecimalFormat;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.*;

import static org.cubewhy.celestial.Celestial.config;
import static org.cubewhy.celestial.Celestial.f;
import static org.cubewhy.celestial.Celestial.*;
import static org.cubewhy.celestial.gui.GuiLauncher.statusBar;

@Slf4j
Expand Down Expand Up @@ -131,7 +128,15 @@ private void initGui() {
// theme
JPanel p5 = new JPanel();
p5.add(new JLabel(f.getString("gui.settings.launcher.theme")));
p5.add(getAutoSaveComboBox(config.getConfig(), "theme", List.of(new String[]{"dark", "light"})));
List<String> themes = new ArrayList<>();
themes.add("dark");
themes.add("light"); // default themes
for (File file : Objects.requireNonNull(themesDir.listFiles())) {
if (file.isFile() && file.getName().endsWith(".json")) {
themes.add(file.getName());
}
}
p5.add(getAutoSaveComboBox(config.getConfig(), "theme", themes));
panelLauncher.add(p5);
// language
JPanel p6 = new JPanel();
Expand Down

0 comments on commit efdb668

Please sign in to comment.