robercoding
02/25/2023, 2:00 PMCompose
desktop
Whenever using Compose, once I enter the tab using Compose
and then navigate to other tool tab, UI stays there and it's not hidden,
If I use FormBuilder.createFormBuilder()
this doesn't happen, does anyone know why is it happening with Compose?
Code & pictures in 🧵class AppSettingsConfigurable : Configurable {
private var composeDemo: ComposeDemoComponent? = null
@Nls(capitalization = Nls.Capitalization.Title)
override fun getDisplayName(): String {
return "SDK: Application Settings Example"
}
override fun getPreferredFocusedComponent(): JComponent? {
return null
}
override fun createComponent(): JComponent? {
println("CREATE UI COMPONENT ")
composeDemo = ComposeDemoComponent()
return composeDemo?.panel
}
override fun isModified(): Boolean {
println("IS MODIFIED")
return false
}
override fun cancel() {
println("CANCEL")
super.cancel()
}
override fun apply() {
println("APPLY")
}
override fun reset() {
println("RESET")
}
override fun disposeUIResources() {
println("Dispose UI")
composeDemo = null
}
}
Component:
class ComposeDemoComponent {
val panel: JComponent
init {
panel = ComposePanel().apply {
setContent {
Text("hello")
}
}
}
}
Plugin xml
<extensions defaultExtensionNs="com.intellij">
<applicationConfigurable
parentId="tools"
instance="com.jetbrains.compose.AppSettingsConfigurable"
id="com.jetbrains.compose.AppSettingsConfigurable"
displayName="SDK: Application Settings Example"
/>
</extensions>
composeDemo.hide()
when tab changes or!?