mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 15:29:15 +01:00
keep the menu icons on their content colour so they are not black
Color.Unspecified disables Icon's colour filter, which fell back to the vector's black; only the filled star should be the primary colour.
This commit is contained in:
@@ -22,6 +22,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api
|
|||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.ListItem
|
import androidx.compose.material3.ListItem
|
||||||
import androidx.compose.material3.ListItemDefaults
|
import androidx.compose.material3.ListItemDefaults
|
||||||
|
import androidx.compose.material3.LocalContentColor
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.ModalBottomSheet
|
import androidx.compose.material3.ModalBottomSheet
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
@@ -235,7 +236,7 @@ private fun StarItem(
|
|||||||
MenuItem(
|
MenuItem(
|
||||||
starIcon(starred),
|
starIcon(starred),
|
||||||
starLabel(starred),
|
starLabel(starred),
|
||||||
tint = if (starred == null) Color.Unspecified else MaterialTheme.colorScheme.primary,
|
tint = if (starred == null) null else MaterialTheme.colorScheme.primary,
|
||||||
) {
|
) {
|
||||||
val previous = starred
|
val previous = starred
|
||||||
val starring = previous == null
|
val starring = previous == null
|
||||||
@@ -250,12 +251,12 @@ private fun StarItem(
|
|||||||
private fun MenuItem(
|
private fun MenuItem(
|
||||||
icon: ImageVector,
|
icon: ImageVector,
|
||||||
label: String,
|
label: String,
|
||||||
tint: Color = Color.Unspecified,
|
tint: Color? = null,
|
||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
) {
|
) {
|
||||||
ListItem(
|
ListItem(
|
||||||
headlineContent = { Text(label) },
|
headlineContent = { Text(label) },
|
||||||
leadingContent = { Icon(icon, contentDescription = null, tint = tint) },
|
leadingContent = { Icon(icon, contentDescription = null, tint = tint ?: LocalContentColor.current) },
|
||||||
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
colors = ListItemDefaults.colors(containerColor = Color.Transparent),
|
||||||
modifier = Modifier.clickable(onClick = onClick),
|
modifier = Modifier.clickable(onClick = onClick),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user