parent
f9a1db90ea
commit
f31f252613
@ -82,8 +82,18 @@ public class ThemeCustomizationPanel extends SettingsPanel {
|
||||
|
||||
add(themes, gbc_themes);
|
||||
|
||||
colorsPanel.setLayout(new BoxLayout(colorsPanel, BoxLayout.Y_AXIS));
|
||||
colorsPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
|
||||
// colorsPanel.setLayout(new BoxLayout(colorsPanel, BoxLayout.Y_AXIS));
|
||||
// colorsPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
|
||||
|
||||
GridBagLayout gbl_colorCustomizations = new GridBagLayout();
|
||||
|
||||
gbl_colorCustomizations.columnWidths = new int[] { 1, 1 };
|
||||
gbl_colorCustomizations.rowHeights = new int[] { 1, 1, 1, 1, 1, 1, 1, 1, 1};
|
||||
gbl_colorCustomizations.columnWeights = new double[] { 1.0, 1.0 };
|
||||
gbl_colorCustomizations.rowWeights = new double[] { 1, 1, 1, 1, 1, 1, 1, 1};
|
||||
|
||||
colorsPanel.setLayout(gbl_colorCustomizations);
|
||||
|
||||
|
||||
Theme theme = Settings.getInstance().getThemes().get(Settings.getInstance().getCurrentTheme());
|
||||
buildCustomizeElements(theme);
|
||||
@ -170,6 +180,7 @@ public class ThemeCustomizationPanel extends SettingsPanel {
|
||||
colorsPanel.removeAll();
|
||||
|
||||
buildCustomizeElements(theme);
|
||||
colorsPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
|
||||
|
||||
GridBagConstraints gbc_createNewTheme = new GridBagConstraints();
|
||||
gbc_createNewTheme.gridx = 0;
|
||||
@ -179,19 +190,18 @@ public class ThemeCustomizationPanel extends SettingsPanel {
|
||||
}
|
||||
|
||||
private void buildCustomizeElements(Theme theme) {
|
||||
buildCustomizeElement(theme, theme.getBackgroundColor(), "Background", "backgroundColor");
|
||||
buildCustomizeElement(theme, theme.getCellColor(), "Cells", "cellColor");
|
||||
buildCustomizeElement(theme, theme.getInteractableForegroundColor(), "Interactable Foreground", "interactableForegroundColor");
|
||||
buildCustomizeElement(theme, theme.getInteractableBackgroundColor(), "Interactable Background", "interactableBackgroundColor");
|
||||
buildCustomizeElement(theme, theme.getMessageColorChat(), "Messages Chat", "messageColorChat");
|
||||
buildCustomizeElement(theme, theme.getDateColorChat(), "Date Chat", "dateColorCat");
|
||||
buildCustomizeElement(theme, theme.getSelectionColor(), "Selection", "selectionColor");
|
||||
buildCustomizeElement(theme, theme.getTypingMessageColor(), "Typing Message", "typingMessageColor");
|
||||
buildCustomizeElement(theme, theme.getUserNameColor(), "User Names", "userNameColor");
|
||||
buildCustomizeElement(theme, theme.getBackgroundColor(), "Background", "backgroundColor", 1);
|
||||
buildCustomizeElement(theme, theme.getCellColor(), "Cells", "cellColor", 2);
|
||||
buildCustomizeElement(theme, theme.getInteractableForegroundColor(), "Interactable Foreground", "interactableForegroundColor", 3);
|
||||
buildCustomizeElement(theme, theme.getInteractableBackgroundColor(), "Interactable Background", "interactableBackgroundColor", 4);
|
||||
buildCustomizeElement(theme, theme.getMessageColorChat(), "Messages Chat", "messageColorChat", 5);
|
||||
buildCustomizeElement(theme, theme.getDateColorChat(), "Date Chat", "dateColorCat", 6);
|
||||
buildCustomizeElement(theme, theme.getSelectionColor(), "Selection", "selectionColor", 7);
|
||||
buildCustomizeElement(theme, theme.getTypingMessageColor(), "Typing Message", "typingMessageColor", 8);
|
||||
buildCustomizeElement(theme, theme.getUserNameColor(), "User Names", "userNameColor", 9);
|
||||
}
|
||||
|
||||
private void buildCustomizeElement(Theme theme, Color color, String name, String colorName) {
|
||||
JPanel panel = new JPanel();
|
||||
private void buildCustomizeElement(Theme theme, Color color, String name, String colorName, int gridy) {
|
||||
JButton button = new JButton();
|
||||
JTextPane textPane = new JTextPane();
|
||||
|
||||
@ -222,12 +232,24 @@ public class ThemeCustomizationPanel extends SettingsPanel {
|
||||
}
|
||||
});
|
||||
|
||||
panel.add(textPane);
|
||||
panel.add(button);
|
||||
panel.setBackground(theme.getCellColor());
|
||||
panel.setAlignmentX(Component.LEFT_ALIGNMENT);
|
||||
GridBagConstraints gbc_textPane = new GridBagConstraints();
|
||||
gbc_textPane.fill = GridBagConstraints.BOTH;
|
||||
gbc_textPane.gridx = 0;
|
||||
gbc_textPane.gridy = gridy;
|
||||
gbc_textPane.anchor = GridBagConstraints.CENTER;
|
||||
gbc_textPane.insets = insets;
|
||||
|
||||
colorsPanel.add(panel);
|
||||
colorsPanel.add(textPane, gbc_textPane);
|
||||
|
||||
|
||||
GridBagConstraints gbc_button = new GridBagConstraints();
|
||||
gbc_button.fill = GridBagConstraints.BOTH;
|
||||
gbc_button.gridx = 1;
|
||||
gbc_button.gridy = gridy;
|
||||
gbc_button.anchor = GridBagConstraints.CENTER;
|
||||
gbc_button.insets = insets;
|
||||
|
||||
colorsPanel.add(button, gbc_button);
|
||||
}
|
||||
|
||||
private Color getInvertedColor(Color color) { return new Color(255 - color.getRed(), 255 - color.getGreen(), 255 - color.getBlue()); }
|
||||
|
Reference in New Issue
Block a user