Allow passing modifier to preference composables

This commit is contained in:
arkon 2022-04-30 09:43:49 -04:00
parent bf6d59cd21
commit cccd09fb5c

View file

@ -22,14 +22,18 @@ import eu.kanade.core.prefs.PreferenceMutableState
import eu.kanade.presentation.util.horizontalPadding import eu.kanade.presentation.util.horizontalPadding
@Composable @Composable
fun Divider() { fun Divider(
modifier: Modifier = Modifier,
) {
androidx.compose.material3.Divider( androidx.compose.material3.Divider(
modifier = modifier,
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.2f), color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.2f),
) )
} }
@Composable @Composable
fun PreferenceRow( fun PreferenceRow(
modifier: Modifier = Modifier,
title: String, title: String,
painter: Painter? = null, painter: Painter? = null,
onClick: () -> Unit = {}, onClick: () -> Unit = {},
@ -45,7 +49,7 @@ fun PreferenceRow(
) )
Row( Row(
modifier = Modifier modifier = modifier
.fillMaxWidth() .fillMaxWidth()
.heightIn(min = height) .heightIn(min = height)
.combinedClickable( .combinedClickable(
@ -91,12 +95,14 @@ fun PreferenceRow(
@Composable @Composable
fun SwitchPreference( fun SwitchPreference(
modifier: Modifier = Modifier,
preference: PreferenceMutableState<Boolean>, preference: PreferenceMutableState<Boolean>,
title: String, title: String,
subtitle: String? = null, subtitle: String? = null,
painter: Painter? = null, painter: Painter? = null,
) { ) {
PreferenceRow( PreferenceRow(
modifier = modifier,
title = title, title = title,
subtitle = subtitle, subtitle = subtitle,
painter = painter, painter = painter,