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(),
imageVector = ImageVector.vectorResource(mode.iconRes),
label = stringResource(stringRes),
title = stringResource(stringRes),
)
}
}

View File

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