Minor drawer item fixes

pull/3080/head
Alex Baker 1 year ago
parent e92703a392
commit 4b2bb87ecf

@ -34,6 +34,7 @@ fun MenuPreview() {
title = "My Tasks", title = "My Tasks",
icon = TasksIcons.ALL_INBOX, icon = TasksIcons.ALL_INBOX,
filter = FilterImpl(), filter = FilterImpl(),
count = 100
), ),
DrawerItem.Header( DrawerItem.Header(
title = "Filters", title = "Filters",
@ -47,6 +48,12 @@ fun MenuPreview() {
NavigationDrawerSubheader.SubheaderType.PREFERENCE, NavigationDrawerSubheader.SubheaderType.PREFERENCE,
"", "",
), ),
),
DrawerItem.Filter(
title = "A really really really really really really really really really really really really really long title",
icon = TasksIcons.CLOUD,
filter = FilterImpl(),
count = 123456,
) )
), ),
onClick = {}, onClick = {},

@ -52,6 +52,7 @@ import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.layout.layout import androidx.compose.ui.layout.layout
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.ImmutableList
import org.jetbrains.compose.resources.stringResource import org.jetbrains.compose.resources.stringResource
@ -189,7 +190,9 @@ internal fun FilterItem(
Text( Text(
text = item.title, text = item.title,
color = MaterialTheme.colorScheme.onSurface, color = MaterialTheme.colorScheme.onSurface,
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f).padding(end = 8.dp),
overflow = TextOverflow.Ellipsis,
maxLines = 1,
) )
if (item.shareCount > 0) { if (item.shareCount > 0) {
Icon( Icon(
@ -202,7 +205,6 @@ internal fun FilterItem(
) )
} }
Box( Box(
modifier = Modifier.width(48.dp),
contentAlignment = Alignment.CenterEnd, contentAlignment = Alignment.CenterEnd,
) { ) {
if (item.count > 0) { if (item.count > 0) {

Loading…
Cancel
Save