I realized that `LocalAppWindow.current.height` is...
# compose-desktop
d
I realized that
LocalAppWindow.current.height
is the Dp height of the window (as Int) INCLUDING the OS window title, right? Is there a target OS independent way to decide the height of the window title? (or is it always 28.dp ?) I wanna determin the max "usable" height of the window, which seems to be LocalAppWindow height MINUS OS window title ...
i
I wanna determin the max "usable" height of the window
Probably there three ways to retrieve that:
Copy code
val window = LocalAppWindow.current.window
// insets will be available only after we show the window (or call appWindow.window.pack())
window.height - <http://window.insets.top|window.insets.top> - window.insets.bottom
// or 
window.contentPane.height
// or
Box(Modifier.fillMaxSize().onSizeChanged { }) {
   App()
}
Depends on how it will be used
🎉 1
b
You can use
BoxWithConstraints
to get the usable height within Composable. E.g.
Copy code
Window(...) {
  BoxWithConstraints(modifier = Modifier.fillMaxSize()) {
    println("${constraints.maxWidth}x${constraints.maxHeight}")
  }
}
👍 1