Is there built-in support for drag-to-resize panel...
# compose-desktop
d
Is there built-in support for drag-to-resize panels? Haven't been able to find anything about it on google.
m
afaik no, but can be easily done with dragging modifier, look at the code-viewer example at jb-compose repo
thank you!
i'm constantly surprised at how easy it is to build new components
(but also somewhat frequently surprised at how many are missing - i had to homeroll a datagrid, for example, but it is 1.0 after all, more will come later, especially in third-party libs)
I'm realizing that I should have spent a few hours reading the samples before embarking on this three-month desktop compose app...
and just like that, it's done
t
By the way, there is a built-in SplitPane compenent https://github.com/JetBrains/compose-jb/tree/master/components/SplitPane
You can include it in gradle using
compose.desktop.components.splitPane
jetpack compose 1
d
oh huh. that's kind of an arbitrary place to find it. thank you
think i'll stick with what's already working, especially since i don't see a super convenient callback to use to update my config file with the user preference
ended up switching and simply updating the config file when a child recomposes. probably not ideal but it works
message has been deleted
t
Not sure why you want to update a “config file”. At least you should wrap it in a SideEffect.
Oh you want to save and restore the percentage when you restart the app. Is that right?
d
yeah, or simply navigate away from the screen and back
t
In that case maybe you could do something like:
Copy code
LaunchedEffect(splitterState.positionPercentage) { /* TODO: update the config */ }
Just an idea, not sure if this is the best way though
d
yeah that's better, thank you