From 2f8ac1db9d65309149bf6192194edd69bf3b2606 Mon Sep 17 00:00:00 2001 From: Nikolay Rykunov Date: Wed, 11 Oct 2023 16:11:35 +0200 Subject: [PATCH] Handle that colorPalette in Dark theme contains non String values --- .../jewel/bridge/BridgePaletteMapperFactory.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ide-laf-bridge/ide-laf-bridge-233/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePaletteMapperFactory.kt b/ide-laf-bridge/ide-laf-bridge-233/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePaletteMapperFactory.kt index c296ac6257..d29ed438fb 100644 --- a/ide-laf-bridge/ide-laf-bridge-233/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePaletteMapperFactory.kt +++ b/ide-laf-bridge/ide-laf-bridge-233/src/main/kotlin/org/jetbrains/jewel/bridge/BridgePaletteMapperFactory.kt @@ -17,7 +17,15 @@ object BridgePaletteMapperFactory : PaletteMapperFactory() { val bean = uiTheme.describe() - val iconColorPalette = bean.colorPalette + // TODO: in New UI + Dark theme values can be non String, but IJColorUIResource + // since these are deserialized values simply casted to Map. + // Let's handle it while it is not fixed in platform + val iconColorPalette = (bean.colorPalette as Map).mapValues { + when (val value = it.value) { + is String -> value + else -> null + } + } val keyPalette = UITheme.getColorPalette() val themeColors = bean.colors