From b74dcb29194acadb9103d4f66d628730aa068730 Mon Sep 17 00:00:00 2001 From: Sebastiano Poggi Date: Tue, 10 Sep 2024 00:06:19 +0200 Subject: [PATCH 1/2] Create NoTheme JewelComposePanel versions (#588) Useful for those cases where you want to have your own theme. --- ide-laf-bridge/api/ide-laf-bridge.api | 2 ++ .../jewel/bridge/JewelComposePanel.kt | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/ide-laf-bridge/api/ide-laf-bridge.api b/ide-laf-bridge/api/ide-laf-bridge.api index c1b87cc2d..322faea32 100644 --- a/ide-laf-bridge/api/ide-laf-bridge.api +++ b/ide-laf-bridge/api/ide-laf-bridge.api @@ -65,8 +65,10 @@ public final class org/jetbrains/jewel/bridge/JewelBridgeException$KeysNotFoundE } public final class org/jetbrains/jewel/bridge/JewelComposePanelKt { + public static final fun JewelComposeNoThemePanel (Lkotlin/jvm/functions/Function2;)Ljavax/swing/JComponent; public static final fun JewelComposePanel (Lkotlin/jvm/functions/Function2;)Ljavax/swing/JComponent; public static final fun JewelToolWindowComposePanel (Lkotlin/jvm/functions/Function2;)Ljavax/swing/JComponent; + public static final fun JewelToolWindowNoThemeComposePanel (Lkotlin/jvm/functions/Function2;)Ljavax/swing/JComponent; public static final fun getLocalComponent ()Landroidx/compose/runtime/ProvidableCompositionLocal; } diff --git a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/JewelComposePanel.kt b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/JewelComposePanel.kt index c5694130a..b5d05c3c7 100644 --- a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/JewelComposePanel.kt +++ b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/JewelComposePanel.kt @@ -47,6 +47,30 @@ public fun JewelToolWindowComposePanel(content: @Composable () -> Unit): JCompon } } +@ExperimentalJewelApi +@Suppress("ktlint:standard:function-naming", "FunctionName") // Swing to Compose bridge API +public fun JewelComposeNoThemePanel(content: @Composable () -> Unit): JComponent = + createJewelComposePanel { jewelPanel -> + setContent { + CompositionLocalProvider(LocalComponent provides this@createJewelComposePanel) { + ComponentDataProviderBridge(jewelPanel, content = content) + } + } + } + +@ExperimentalJewelApi +@Suppress("ktlint:standard:function-naming", "FunctionName") // Swing to Compose bridge API +public fun JewelToolWindowNoThemeComposePanel(content: @Composable () -> Unit): JComponent = + createJewelComposePanel { jewelPanel -> + setContent { + Compose17IJSizeBugWorkaround { + CompositionLocalProvider(LocalComponent provides this@createJewelComposePanel) { + ComponentDataProviderBridge(jewelPanel, content = content) + } + } + } + } + private fun createJewelComposePanel(config: ComposePanel.(JewelComposePanel) -> Unit): JewelComposePanel { val jewelPanel = JewelComposePanel() jewelPanel.layout = BorderLayout() From 70a3ae375ef96965d33009bbfaec5320b3442214 Mon Sep 17 00:00:00 2001 From: Sebastiano Poggi Date: Mon, 9 Sep 2024 15:05:22 -0700 Subject: [PATCH 2/2] Bump version to 0.24.2 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 587755974..6c6a359b9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,4 +10,4 @@ org.jetbrains.intellij.platform.buildFeature.useBinaryReleases=false jdk.level=17 ijp.target=242 -jewel.release.version=0.24.1 +jewel.release.version=0.24.2