mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-28 09:25:09 +00:00
ChatInfoImage: dark themes use secondaryVariant for default avatar to match UserPicker
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.
This commit is contained in:
+9
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user