Fix cut off labels in reader sheet toggles

This commit is contained in:
arkon 2023-09-11 18:39:36 -04:00
parent 8824c7dbe3
commit f9754f4f58
3 changed files with 13 additions and 5 deletions

View file

@ -45,7 +45,7 @@ fun OrientationModeSelectDialog(
}, },
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
imageVector = ImageVector.vectorResource(mode.iconRes), imageVector = ImageVector.vectorResource(mode.iconRes),
label = stringResource(stringRes), title = stringResource(stringRes),
) )
} }
} }

View file

@ -46,7 +46,7 @@ fun ReadingModeSelectDialog(
}, },
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
imageVector = ImageVector.vectorResource(mode.iconRes), imageVector = ImageVector.vectorResource(mode.iconRes),
label = stringResource(stringRes), title = stringResource(stringRes),
) )
} }
} }

View file

@ -3,6 +3,7 @@ package tachiyomi.presentation.core.components.material
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material3.FilledIconToggleButton import androidx.compose.material3.FilledIconToggleButton
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
@ -12,6 +13,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
@Composable @Composable
fun IconToggleButton( fun IconToggleButton(
@ -19,12 +22,13 @@ fun IconToggleButton(
onCheckedChange: (Boolean) -> Unit, onCheckedChange: (Boolean) -> Unit,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
imageVector: ImageVector, imageVector: ImageVector,
label: String, title: String,
) { ) {
FilledIconToggleButton( FilledIconToggleButton(
checked = checked, checked = checked,
onCheckedChange = onCheckedChange, onCheckedChange = onCheckedChange,
modifier = modifier, modifier = modifier
.height(48.dp),
) { ) {
Row( Row(
horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small), horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small),
@ -38,7 +42,11 @@ fun IconToggleButton(
contentDescription = null, contentDescription = null,
) )
Text(label) Text(
text = title,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
)
} }
} }
} }