diff --git a/src/main/java/envoy/client/Settings.java b/src/main/java/envoy/client/Settings.java index 21a1afa..e84e647 100644 --- a/src/main/java/envoy/client/Settings.java +++ b/src/main/java/envoy/client/Settings.java @@ -76,6 +76,7 @@ public class Settings { if(obj instanceof HashMap) themes = (Map) obj; } catch (IOException | ClassNotFoundException e) { themes = new HashMap<>(); + currentTheme = "dark"; e.printStackTrace(); } diff --git a/src/main/java/envoy/client/ui/SettingsScreen.java b/src/main/java/envoy/client/ui/SettingsScreen.java index a003972..6d5c94d 100644 --- a/src/main/java/envoy/client/ui/SettingsScreen.java +++ b/src/main/java/envoy/client/ui/SettingsScreen.java @@ -8,7 +8,6 @@ import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; -import java.awt.LayoutManager; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.Arrays; @@ -48,8 +47,7 @@ public class SettingsScreen extends JDialog { private JPanel buttonPane = new JPanel(); private JPanel themeContent = new JPanel(); - private String[] themeArray = { Settings.getInstance().getThemes().get("dark").getThemeName(), - Settings.getInstance().getThemes().get("light").getThemeName() }; + private String[] themeArray = Settings.getInstance().getThemes().keySet().toArray(new String[0]); private JComboBox themes = new JComboBox(themeArray); private GridBagConstraints gbc_themeContent = new GridBagConstraints(); @@ -198,10 +196,16 @@ public class SettingsScreen extends JDialog { themeContent.add(themes, gbc_themes); - colorsPanel.setLayout((LayoutManager) new BoxLayout(colorsPanel, BoxLayout.Y_AXIS)); + colorsPanel.setLayout(new BoxLayout(colorsPanel, BoxLayout.Y_AXIS)); colorsPanel.setAlignmentX(Component.LEFT_ALIGNMENT); - buildCustomizeElement(new JPanel(), new JButton(), new JTextPane(), theme, theme.getBackgroundColor(), "Background", 1); + buildCustomizeElement(new JPanel(), + new JButton(), + new JTextPane(), + theme, + theme.getBackgroundColor(), + "Background", + 1); buildCustomizeElement(new JPanel(), new JButton(), new JTextPane(), theme, theme.getCellColor(), "Cells", 2); buildCustomizeElement(new JPanel(), new JButton(),