diff --git a/src/main/java/cz/kamma/kfmanager/ui/SettingsDialog.java b/src/main/java/cz/kamma/kfmanager/ui/SettingsDialog.java index 6ab4fbf..aac60cb 100644 --- a/src/main/java/cz/kamma/kfmanager/ui/SettingsDialog.java +++ b/src/main/java/cz/kamma/kfmanager/ui/SettingsDialog.java @@ -268,6 +268,11 @@ public class SettingsDialog extends JDialog { Color selColor = config != null ? config.getSelectionColor() : null; for (Component c : container.getComponents()) { + // Skip specialized buttons that manage their own background colors + if (c instanceof JComponent && Boolean.TRUE.equals(((JComponent) c).getClientProperty("isColorButton"))) { + continue; + } + if (c instanceof JPanel || c instanceof JScrollPane || c instanceof JViewport || c instanceof JTabbedPane || c instanceof JButton || c instanceof JSplitPane || c instanceof JList) { c.setBackground(bg); } @@ -329,6 +334,7 @@ public class SettingsDialog extends JDialog { appearanceBgBtn = createColorButton(config.getBackgroundColor(), "Choose background color", c -> { config.setBackgroundColor(c); + applyAppearance(); if (onChange != null) onChange.run(); }); gbc.gridx = 1; gbc.gridy = row++; gbc.weightx = 1.0; @@ -341,6 +347,7 @@ public class SettingsDialog extends JDialog { appearanceSelBtn = createColorButton(config.getSelectionColor() != null ? config.getSelectionColor() : new Color(184, 207, 229), "Choose selection color", c -> { config.setSelectionColor(c); + applyAppearance(); if (onChange != null) onChange.run(); }); gbc.gridx = 1; gbc.gridy = row++; gbc.weightx = 1.0; @@ -390,6 +397,7 @@ public class SettingsDialog extends JDialog { } } }; + btn.putClientProperty("isColorButton", Boolean.TRUE); btn.setOpaque(true); btn.setContentAreaFilled(false); btn.setFocusPainted(false);