mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
tint the filled star with the primary colour
This commit is contained in:
@@ -232,7 +232,11 @@ private fun StarItem(
|
|||||||
) {
|
) {
|
||||||
var starred by remember(current) { mutableStateOf(current) }
|
var starred by remember(current) { mutableStateOf(current) }
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
MenuItem(starIcon(starred), starLabel(starred)) {
|
MenuItem(
|
||||||
|
starIcon(starred),
|
||||||
|
starLabel(starred),
|
||||||
|
tint = if (starred == null) Color.Unspecified else MaterialTheme.colorScheme.primary,
|
||||||
|
) {
|
||||||
val previous = starred
|
val previous = starred
|
||||||
val starring = previous == null
|
val starring = previous == null
|
||||||
starred = if (starring) System.currentTimeMillis() else null
|
starred = if (starring) System.currentTimeMillis() else null
|
||||||
@@ -246,11 +250,12 @@ private fun StarItem(
|
|||||||
private fun MenuItem(
|
private fun MenuItem(
|
||||||
icon: ImageVector,
|
icon: ImageVector,
|
||||||
label: String,
|
label: String,
|
||||||
|
tint: Color = Color.Unspecified,
|
||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
) {
|
) {
|
||||||
ListItem(
|
ListItem(
|
||||||
headlineContent = { Text(label) },
|
headlineContent = { Text(label) },
|
||||||
leadingContent = { Icon(icon, contentDescription = null) },
|
leadingContent = { Icon(icon, contentDescription = null, tint = tint) },
|
||||||
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