Skip to content

Commit c448a43

Browse files
committed
fix(widget): tint OptionsBar icons with onSurface in light mode
Icon drawables in the widget OptionsBar have a hardcoded white fillColor. Without a colorFilter the icons were invisible on light backgrounds. Apply ColorFilter.tint(GlanceTheme.colors.onSurface) to all four Image composables (lock, refresh, settings, open-in-app) so they adapt correctly to both light and dark system themes.
1 parent 399b173 commit c448a43

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

android/app/src/main/java/dev/dettmer/simplenotes/widget/NoteWidgetContent.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import androidx.compose.ui.unit.dp
99
import androidx.compose.ui.unit.sp
1010
import androidx.glance.GlanceId
1111
import androidx.glance.GlanceModifier
12+
import androidx.glance.ColorFilter
1213
import androidx.glance.GlanceTheme
1314
import androidx.glance.Image
1415
import androidx.glance.ImageProvider
@@ -336,6 +337,7 @@ private fun OptionsBar(isLocked: Boolean, noteId: String, glanceId: GlanceId) {
336337
if (isLocked) R.drawable.ic_lock_open else R.drawable.ic_lock
337338
),
338339
contentDescription = if (isLocked) "Unlock" else "Lock",
340+
colorFilter = ColorFilter.tint(GlanceTheme.colors.onSurface),
339341
modifier = GlanceModifier
340342
.size(36.dp)
341343
.padding(6.dp)
@@ -354,6 +356,7 @@ private fun OptionsBar(isLocked: Boolean, noteId: String, glanceId: GlanceId) {
354356
Image(
355357
provider = ImageProvider(R.drawable.ic_refresh),
356358
contentDescription = "Refresh",
359+
colorFilter = ColorFilter.tint(GlanceTheme.colors.onSurface),
357360
modifier = GlanceModifier
358361
.size(36.dp)
359362
.padding(6.dp)
@@ -372,6 +375,7 @@ private fun OptionsBar(isLocked: Boolean, noteId: String, glanceId: GlanceId) {
372375
Image(
373376
provider = ImageProvider(R.drawable.ic_settings),
374377
contentDescription = "Settings",
378+
colorFilter = ColorFilter.tint(GlanceTheme.colors.onSurface),
375379
modifier = GlanceModifier
376380
.size(36.dp)
377381
.padding(6.dp)
@@ -390,6 +394,7 @@ private fun OptionsBar(isLocked: Boolean, noteId: String, glanceId: GlanceId) {
390394
Image(
391395
provider = ImageProvider(R.drawable.ic_open_in_new),
392396
contentDescription = "Open",
397+
colorFilter = ColorFilter.tint(GlanceTheme.colors.onSurface),
393398
modifier = GlanceModifier
394399
.size(36.dp)
395400
.padding(6.dp)

0 commit comments

Comments
 (0)