Grigorii Yurkov
11/10/2020, 3:13 PMwrap_content
?Igor Demin
11/10/2020, 5:09 PMfun main() = Window(size = IntSize.Zero, undecorated = true) {
val window = AppWindowAmbient.current!!
val density = DensityAmbient.current
Box(
Modifier
.sizeIn(maxWidth = Dp.Infinity, maxHeight = Dp.Infinity)
.onSizeChanged {
with(density) {
window.setSize(
it.width.toDp().value.toInt(),
it.height.toDp().value.toInt()
)
window.window.isResizable = false
}
}
) {
Text("Text", style = TextStyle(fontSize = 300.sp))
}
}
I am using undecorated = true here.
For decorated Window there is a small glitch at the start of the application (we can see "Window with zero size" for a few milliseconds)Grigorii Yurkov
11/10/2020, 5:17 PMText
(I highlighted Box
background)Grigorii Yurkov
11/10/2020, 5:21 PM