Zoff
10/29/2023, 8:36 AMZoff
10/29/2023, 8:37 AMDima Avdeev
10/29/2023, 2:02 PMfun main() = application {
val windowState = rememberWindowState()
Window(
onCloseRequest = ::exitApplication,
state = windowState,
onKeyEvent = {
when (it.key) {
Key.F11 -> {
windowState.placement = WindowPlacement.Fullscreen
true
}
Key.Escape -> {
windowState.placement = WindowPlacement.Floating
true
}
else -> false
}
}
) {
Button(onClick = {
windowState.placement = when(windowState.placement) {
WindowPlacement.Fullscreen -> WindowPlacement.Floating
else -> WindowPlacement.Fullscreen
}
}) {
Text("Change window mode")
}
}
}
Zoff
10/30/2023, 8:12 PMDima Avdeev
10/31/2023, 12:53 PM