diff --git a/src/main/java/envoy/client/ui/PrimaryToggleSwitch.java b/src/main/java/envoy/client/ui/PrimaryToggleSwitch.java index d6a23cc..6ea198d 100644 --- a/src/main/java/envoy/client/ui/PrimaryToggleSwitch.java +++ b/src/main/java/envoy/client/ui/PrimaryToggleSwitch.java @@ -40,6 +40,7 @@ public class PrimaryToggleSwitch extends JButton { setFocusPainted(false); setContentAreaFilled(false); + state = settingsItem.get(); addActionListener((evt) -> { state = !state; settingsItem.set(state); revalidate(); repaint(); }); } @@ -47,8 +48,13 @@ public class PrimaryToggleSwitch extends JButton { public void paintComponent(Graphics g) { g.setColor(state ? Color.GREEN : Color.LIGHT_GRAY); g.fillRect(0, 0, getWidth(), getHeight()); - g.setColor(state ? Color.LIGHT_GRAY - : Settings.getInstance().getThemes().get(Settings.getInstance().getCurrentTheme()).getInteractableBackgroundColor()); - g.fillRect(0, getWidth() / 2, getWidth(), getHeight()); + + g.setColor(Settings.getInstance().getThemes().get(Settings.getInstance().getCurrentTheme()).getInteractableBackgroundColor()); + + if (state) { + g.fillRect(25, 0, 25, 25); + } else { + g.fillRect(0, 0, 25, 25); + } } } \ No newline at end of file diff --git a/src/main/java/envoy/client/ui/settings/General.java b/src/main/java/envoy/client/ui/settings/General.java index 9b6339a..59a6345 100644 --- a/src/main/java/envoy/client/ui/settings/General.java +++ b/src/main/java/envoy/client/ui/settings/General.java @@ -81,5 +81,5 @@ public class General extends SettingsPanel { } @Override - public ActionListener getOkButtonAction() { return null; } + public ActionListener getOkButtonAction() { return (evt) -> {}; } } \ No newline at end of file