Skip to content
Snippets Groups Projects
Unverified Commit 69dbc82e authored by Igor Demin's avatar Igor Demin Committed by GitHub
Browse files

Update tutorials

parent b0512503
No related branches found
No related tags found
No related merge requests found
...@@ -336,17 +336,18 @@ fun main() = application { ...@@ -336,17 +336,18 @@ fun main() = application {
val state = rememberWindowState() val state = rememberWindowState()
Window(state) { Window(state) {
} // Content
LaunchedEffect(state) { LaunchedEffect(state) {
snapshotFlow { state.size } snapshotFlow { state.size }
.onEach(::onWindowResize) .onEach(::onWindowResize)
.launchIn(this) .launchIn(this)
snapshotFlow { state.position } snapshotFlow { state.position }
.filterNot { it.isInitial } .filterNot { it.isInitial }
.onEach(::onWindowRelocate) .onEach(::onWindowRelocate)
.launchIn(this) .launchIn(this)
}
} }
} }
...@@ -357,7 +358,6 @@ private fun onWindowResize(size: WindowSize) { ...@@ -357,7 +358,6 @@ private fun onWindowResize(size: WindowSize) {
private fun onWindowRelocate(position: WindowPosition) { private fun onWindowRelocate(position: WindowPosition) {
println("onWindowRelocate $position") println("onWindowRelocate $position")
} }
``` ```
## Handle window-level shortcuts ## Handle window-level shortcuts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment