Fixes themes list display bug and error when loading client with custom
theme
This commit is contained in:
parent
057c21061b
commit
d36f3cc9dd
@ -76,6 +76,7 @@ public class Settings {
|
|||||||
if(obj instanceof HashMap) themes = (Map<String, Theme>) obj;
|
if(obj instanceof HashMap) themes = (Map<String, Theme>) obj;
|
||||||
} catch (IOException | ClassNotFoundException e) {
|
} catch (IOException | ClassNotFoundException e) {
|
||||||
themes = new HashMap<>();
|
themes = new HashMap<>();
|
||||||
|
currentTheme = "dark";
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ import java.awt.Font;
|
|||||||
import java.awt.GridBagConstraints;
|
import java.awt.GridBagConstraints;
|
||||||
import java.awt.GridBagLayout;
|
import java.awt.GridBagLayout;
|
||||||
import java.awt.Insets;
|
import java.awt.Insets;
|
||||||
import java.awt.LayoutManager;
|
|
||||||
import java.awt.event.ItemEvent;
|
import java.awt.event.ItemEvent;
|
||||||
import java.awt.event.ItemListener;
|
import java.awt.event.ItemListener;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -48,8 +47,7 @@ public class SettingsScreen extends JDialog {
|
|||||||
private JPanel buttonPane = new JPanel();
|
private JPanel buttonPane = new JPanel();
|
||||||
|
|
||||||
private JPanel themeContent = new JPanel();
|
private JPanel themeContent = new JPanel();
|
||||||
private String[] themeArray = { Settings.getInstance().getThemes().get("dark").getThemeName(),
|
private String[] themeArray = Settings.getInstance().getThemes().keySet().toArray(new String[0]);
|
||||||
Settings.getInstance().getThemes().get("light").getThemeName() };
|
|
||||||
private JComboBox<String> themes = new JComboBox<String>(themeArray);
|
private JComboBox<String> themes = new JComboBox<String>(themeArray);
|
||||||
|
|
||||||
private GridBagConstraints gbc_themeContent = new GridBagConstraints();
|
private GridBagConstraints gbc_themeContent = new GridBagConstraints();
|
||||||
@ -198,10 +196,16 @@ public class SettingsScreen extends JDialog {
|
|||||||
|
|
||||||
themeContent.add(themes, gbc_themes);
|
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);
|
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(), new JTextPane(), theme, theme.getCellColor(), "Cells", 2);
|
||||||
buildCustomizeElement(new JPanel(),
|
buildCustomizeElement(new JPanel(),
|
||||||
new JButton(),
|
new JButton(),
|
||||||
|
Reference in New Issue
Block a user