From deb47f1e7d4243ca35b503dcac620bc5707a464b Mon Sep 17 00:00:00 2001 From: Bogdan Kirilenko Date: Mon, 31 Jul 2023 04:25:03 +0200 Subject: [PATCH] Tuned theme switcher a bit --- src/main/kotlin/util/PopupViewThemeManager.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/util/PopupViewThemeManager.kt b/src/main/kotlin/util/PopupViewThemeManager.kt index 58eef64..efde183 100644 --- a/src/main/kotlin/util/PopupViewThemeManager.kt +++ b/src/main/kotlin/util/PopupViewThemeManager.kt @@ -18,26 +18,35 @@ object PopupViewThemeManager : SettingsObserver { private fun setDarkTheme() { UIManager.put("OptionPane.background", Color.DARK_GRAY) - UIManager.put("Panel.background", Color.DARK_GRAY) + UIManager.put("OptionPane.foreground", Color.DARK_GRAY) UIManager.put("OptionPane.messageForeground", Color.WHITE) + UIManager.put("Panel.background", Color.DARK_GRAY) + UIManager.put("Panel.foreground", Color.WHITE) + UIManager.put("Label.foreground", Color.WHITE) UIManager.put("Button.background", Color.GRAY) UIManager.put("Button.foreground", Color.WHITE) UIManager.put("ComboBox.background", Color.DARK_GRAY) UIManager.put("ComboBox.foreground", Color.WHITE) UIManager.put("ComboBox.selectionBackground", Color.GRAY) UIManager.put("ComboBox.selectionForeground", Color.WHITE) + UIManager.put("CheckBox.foreground", Color.WHITE) } private fun setDefaultTheme() { + // in light theme - just reset to defaults UIManager.put("OptionPane.background", null) - UIManager.put("Panel.background", null) + UIManager.put("OptionPane.foreground", null) UIManager.put("OptionPane.messageForeground", null) + UIManager.put("Panel.background", null) + UIManager.put("Panel.foreground", null) + UIManager.put("Label.foreground", null) UIManager.put("Button.background", null) UIManager.put("Button.foreground", null) UIManager.put("ComboBox.background", null) UIManager.put("ComboBox.foreground", null) UIManager.put("ComboBox.selectionBackground", null) UIManager.put("ComboBox.selectionForeground", null) + UIManager.put("CheckBox.foreground", null) } override fun onColorThemeChanged(newColorTheme: ColorTheme) {