From 84ec0e342b32c9ecfe1a5d105a33def6f0c4c581 Mon Sep 17 00:00:00 2001 From: James Rich Date: Wed, 3 Jun 2026 11:39:45 -0500 Subject: [PATCH] fix(map): keep compass icon visible while following bearing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CompassButton tinted its icon `colorScheme.primary` while following the phone bearing, but FilledIconButton's container is also `primary` — so the icon was painted the same color as its own background and disappeared. Tint it `StatusBlue` instead (consistent with the existing `StatusRed` north indicator), which stays legible on the primary-colored button. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../meshtastic/feature/map/component/MapControlsOverlay.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/MapControlsOverlay.kt b/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/MapControlsOverlay.kt index 1445424b3f..454bc72b22 100644 --- a/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/MapControlsOverlay.kt +++ b/feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/component/MapControlsOverlay.kt @@ -42,6 +42,7 @@ import org.meshtastic.core.ui.icon.MeshtasticIcons import org.meshtastic.core.ui.icon.MyLocation import org.meshtastic.core.ui.icon.Refresh import org.meshtastic.core.ui.icon.Tune +import org.meshtastic.core.ui.theme.StatusColors.StatusBlue import org.meshtastic.core.ui.theme.StatusColors.StatusRed /** @@ -127,9 +128,11 @@ fun MapControlsOverlay( @Composable private fun CompassButton(onClick: () -> Unit, bearing: Float, isFollowing: Boolean) { + // Tint, not `primary` — tinting the icon `primary` painted it the same color as its own primary-colored + // button background, making the compass disappear while following. val iconTint = when { - isFollowing -> MaterialTheme.colorScheme.primary + isFollowing -> MaterialTheme.colorScheme.StatusBlue bearing == 0f -> MaterialTheme.colorScheme.StatusRed else -> null }