Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 9ebb530c authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé Committed by GitHub
Browse files

Merge pull request #8806 from marcRDZ/fix-8738_drawer-item-maxLines

Set maxLines and ellipsis on drawer folder labels
parents 5938fb89 9a2080ed
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import app.k9mail.core.ui.compose.theme2.MainTheme
import androidx.compose.material3.Text as Material3Text

@@ -14,12 +15,16 @@ fun TextLabelLarge(
    modifier: Modifier = Modifier,
    color: Color = Color.Unspecified,
    textAlign: TextAlign? = null,
    overflow: TextOverflow = TextOverflow.Ellipsis,
    maxLines: Int = Int.MAX_VALUE,
) {
    Material3Text(
        text = text,
        modifier = modifier,
        color = color,
        textAlign = textAlign,
        maxLines = maxLines,
        overflow = overflow,
        style = MainTheme.typography.labelLarge,
    )
}
@@ -30,12 +35,16 @@ fun TextLabelLarge(
    modifier: Modifier = Modifier,
    color: Color = Color.Unspecified,
    textAlign: TextAlign? = null,
    overflow: TextOverflow = TextOverflow.Ellipsis,
    maxLines: Int = Int.MAX_VALUE,
) {
    Material3Text(
        text = text,
        modifier = modifier,
        color = color,
        textAlign = textAlign,
        maxLines = maxLines,
        overflow = overflow,
        style = MainTheme.typography.labelLarge,
    )
}
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ fun NavigationDrawerItem(
    badge: (@Composable () -> Unit)? = null,
) {
    Material3NavigationDrawerItem(
        label = { TextLabelLarge(text = label) },
        label = { TextLabelLarge(text = label, maxLines = 2) },
        selected = selected,
        onClick = onClick,
        modifier = Modifier
@@ -39,7 +39,7 @@ fun NavigationDrawerItem(
    badge: (@Composable () -> Unit)? = null,
) {
    Material3NavigationDrawerItem(
        label = { TextLabelLarge(text = label) },
        label = { TextLabelLarge(text = label, maxLines = 2) },
        selected = selected,
        onClick = onClick,
        modifier = Modifier