From eac067a717563b6594f0122047b74398d9ea344c Mon Sep 17 00:00:00 2001 From: another-simple-pixel Date: Sat, 16 May 2026 14:34:25 -0700 Subject: [PATCH] ChatInfoImage: dark themes use secondaryVariant for default avatar to match UserPicker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mixWith canvas-darkening formula only lands well in LIGHT. For DARK / BLACK / SIMPLEX, fall back to secondaryVariant, which UserPicker already uses for the active profile avatar — keeps placeholder avatars consistent across the app on dark themes. --- .../simplex/common/views/helpers/ChatInfoImage.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ChatInfoImage.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ChatInfoImage.kt index ab92570636..abdaa23768 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ChatInfoImage.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ChatInfoImage.kt @@ -25,7 +25,14 @@ import dev.icerock.moko.resources.ImageResource import kotlin.math.max @Composable -fun ChatInfoImage(chatInfo: ChatInfo, size: Dp, iconColor: Color = MaterialTheme.colors.background.mixWith(MaterialTheme.colors.onBackground, 0.88f), shadow: Boolean = false) { +private fun defaultProfileIconColor(): Color = + if (CurrentColors.value.base == DefaultTheme.LIGHT) + MaterialTheme.colors.background.mixWith(MaterialTheme.colors.onBackground, 0.88f) + else + MaterialTheme.colors.secondaryVariant + +@Composable +fun ChatInfoImage(chatInfo: ChatInfo, size: Dp, iconColor: Color = defaultProfileIconColor(), shadow: Boolean = false) { val icon = when (chatInfo) { is ChatInfo.Group -> chatInfo.groupInfo.chatIconName @@ -52,7 +59,7 @@ fun ProfileImage( size: Dp, image: String? = null, icon: ImageResource = MR.images.ic_account_circle_filled, - color: Color = MaterialTheme.colors.background.mixWith(MaterialTheme.colors.onBackground, 0.88f), + color: Color = defaultProfileIconColor(), backgroundColor: Color? = null, blurred: Boolean = false, async: Boolean = false