JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.93k stars 1.16k forks source link

LazyRow on ComposePanel is not scrollable #3198

Open kodeplateform opened 1 year ago

kodeplateform commented 1 year ago

Helllo, I'm working on a UI for a player using Jetpack Compose for Desktop. My goal is to overlay Composables on top of a video player view, but I'm facing some issues.

Here is the core part of my code:

SwingPanel(
    modifier = Modifier.fillMaxSize(),
    factory = {
        ComposePanel().apply {
            setContent {
                Box (
                    modifier = Modifier.fillMaxSize()
                ) {
                    SwingPanel(
                        modifier = Modifier.fillMaxSize(),
                        factory = {
                            videoPlayerViewModel.player.getPlayerView()
                        }
                    )
                    Box (
                        modifier = Modifier.fillMaxWidth().height(200.dp),
                        contentAlignment = Alignment.BottomStart

                    ) {
                        SwingPanel(
                            modifier = Modifier,
                            factory = {

                                ComposePanel().apply {
                                    setContent {
                                        RandomLazyRow()
                                    }
                                }
                            }
                        )
                    }
                }
            }
        }
    }
)

Here are the problems I am facing with this setup:

Transparency problem: The ComposePanel doesn't seem to respect transparency settings on both Windows and Mac platforms. This prevents me from creating the desired UI effects. Related issues have been discussed in https://github.com/JetBrains/compose-multiplatform/issues/1061, https://github.com/JetBrains/compose-multiplatform/issues/2461 ,

Scrolling issue: I can't scroll through items in a LazyRow using the mouse. The scrolling works programmatically but does not respond to mouse scroll events.

ps: The reason I am using ComposePanel is due to limitations with SwingPanel, which does not properly handle overlaying Composables on top of it #2926, #1521,

okushnikov commented 3 weeks ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.