5c5468f9af
* Settings: M3 and two pane ui * TrackingLoginDialog: Move close button * Use small top bar * Revert "Update voyager to v1.0.0-rc02" This reverts commit 570fec6ea622a7deae44668f4d9c3317699de2aa. https://github.com/adrielcafe/voyager/issues/62
36 lines
1.1 KiB
Kotlin
36 lines
1.1 KiB
Kotlin
package eu.kanade.presentation.components
|
|
|
|
import androidx.compose.foundation.layout.Box
|
|
import androidx.compose.foundation.layout.BoxScope
|
|
import androidx.compose.foundation.layout.BoxWithConstraints
|
|
import androidx.compose.foundation.layout.fillMaxSize
|
|
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
|
|
|
|
@Composable
|
|
fun TwoPanelBox(
|
|
modifier: Modifier = Modifier,
|
|
startContent: @Composable BoxScope.() -> Unit,
|
|
endContent: @Composable BoxScope.() -> Unit,
|
|
) {
|
|
BoxWithConstraints(modifier = modifier.fillMaxSize()) {
|
|
val firstWidth = (maxWidth / 2).coerceAtMost(450.dp)
|
|
val secondWidth = maxWidth - firstWidth
|
|
Box(
|
|
modifier = Modifier
|
|
.align(Alignment.TopStart)
|
|
.width(firstWidth),
|
|
content = startContent,
|
|
)
|
|
Box(
|
|
modifier = Modifier
|
|
.align(Alignment.TopEnd)
|
|
.width(secondWidth),
|
|
content = endContent,
|
|
)
|
|
}
|
|
}
|