Open igordmn opened 3 years ago
@LAP2 implemented SplitPane here
Thanks!
Things that we need to do or think about:
(it is important and we need to think about it before publication)
How can we implement multiple columns? Now we can put one SplitPane into another. Is there a better way? In which cases nested SplitPane can cause undesirable behavior?
Is an API for defining custom splitter minimal and powerful?
Write tests:
Configure maven publication
Try to use SplitPane in codeviewer, issues and widgetsgallery.
Just tried it. Several issues:
I've just taken a look at the SplitPane usage. It's cool that it already works, thanks! At the same time, I have some ideas how it can be improved. Should I write it here or in separate tickets? For now, writing here.
Is it right that we change size in percent's, not in pixels? Usual desktop programs don't work this way.
We have the whole window divided by SplitPane and it's a bit unexpected to see that the percent is persisted when the whole window is resized: both halves are resized.
Probably in addition to rememberSplitPaneState(0.3f)
, something like rememberSplitPaneFirstSizeState(240.dp)
can be introduced. In case of our app side when the "first" half is the navigation, it's expected that it has a persistent size during whole app resizes but a changeable size when the user wants to resize it manually.
Also, we have too big minimum sizes for first and second halves (240 and 640 dp), so it often happens that the app is smaller, and the splitter can't be moved at all. Looks like a bug, but it isn't in fact.
However, would be cool to somehow show the user that it's not a bug. For example, avoid applying the pointerHoverIcon(PointerIcon(Cursor(Cursor.E_RESIZE_CURSOR)))
modifier that we apply now unconditionally. Can we somehow determine that the splitter is now in the fixed state? This way, we can add a condition for the hover cursor.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Consider implementing SplitPane component available as a maven artifact: https://github.com/JetBrains/compose-jb/tree/master/components
P.S. we implemented non-ideal version of it in: https://github.com/JetBrains/compose-jb/blob/9e67cfc916f696220d630ceb6e5b67e9570777a3/examples/codeviewer/common/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/CodeViewerView.kt#L56
See also: https://github.com/JetBrains/compose-jb/issues/148