26 lines
815 B
Kotlin
26 lines
815 B
Kotlin
import androidx.compose.foundation.layout.Box
|
|
import androidx.compose.foundation.layout.fillMaxSize
|
|
import androidx.compose.foundation.layout.height
|
|
import androidx.compose.foundation.layout.width
|
|
import androidx.compose.runtime.Composable
|
|
import androidx.compose.ui.Alignment
|
|
import androidx.compose.ui.Modifier
|
|
import androidx.compose.ui.unit.dp
|
|
import kotlinx.browser.window
|
|
|
|
@Composable
|
|
actual fun ResizableWindow(content: @Composable () -> Unit) {
|
|
Box(
|
|
modifier = Modifier.fillMaxSize(),
|
|
contentAlignment = Alignment.Center
|
|
) {
|
|
Box(
|
|
modifier = Modifier
|
|
.width(window.innerWidth.coerceIn(360..600).dp)
|
|
.height(window.innerHeight.coerceIn(minimumValue = 360, maximumValue = null).dp)
|
|
) {
|
|
content()
|
|
}
|
|
}
|
|
}
|