diff --git a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeUtils.kt b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeUtils.kt index fbaf2d7e4..e6ee32764 100644 --- a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeUtils.kt +++ b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/BridgeUtils.kt @@ -159,8 +159,12 @@ internal fun retrieveIcon( baseIconPath: String, iconData: IntelliJThemeIconData, svgLoader: SvgLoader, + prefixTokensProvider: (state: T) -> String = { "" }, + suffixTokensProvider: (state: T) -> String = { "" }, ): PainterProvider = IntelliJResourcePainterProvider.stateful( basePath = iconData.iconOverrides[baseIconPath] ?: baseIconPath, svgLoader, + prefixTokensProvider, + suffixTokensProvider, ) diff --git a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/IntelliJResourcePainterProvider.kt b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/IntelliJResourcePainterProvider.kt index 75a387d4b..671328835 100644 --- a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/IntelliJResourcePainterProvider.kt +++ b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/IntelliJResourcePainterProvider.kt @@ -32,7 +32,12 @@ class IntelliJResourcePainterProvider @InternalJewelApi constructor( fun stateful( basePath: String, svgLoader: SvgLoader, - pathPatcher: ResourcePathPatcher = StatefulResourcePathPatcher(), + prefixTokensProvider: (state: T) -> String = { "" }, + suffixTokensProvider: (state: T) -> String = { "" }, + pathPatcher: ResourcePathPatcher = StatefulResourcePathPatcher( + prefixTokensProvider, + suffixTokensProvider, + ), ) = IntelliJResourcePainterProvider(basePath, svgLoader, pathPatcher, IntelliJIconMapper) }