From f758a5526a1e650134629b4f66d7edfdb42ce4ee Mon Sep 17 00:00:00 2001 From: Stanislav Dmitrenko <7953703+avently@users.noreply.github.com> Date: Tue, 2 Jan 2024 21:28:36 +0700 Subject: [PATCH] android, desktop: specifying text color globally (#3635) * android, desktop: specifying text color globally * typography --- .../chat/simplex/common/ui/theme/Theme.kt | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/ui/theme/Theme.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/ui/theme/Theme.kt index 6af3156ca2..21bee2b2b3 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/ui/theme/Theme.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/ui/theme/Theme.kt @@ -6,6 +6,7 @@ import androidx.compose.runtime.* import androidx.compose.ui.Modifier import androidx.compose.ui.geometry.Offset import androidx.compose.ui.graphics.* +import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.dp import chat.simplex.common.model.ChatController import chat.simplex.common.platform.isInNightMode @@ -282,8 +283,27 @@ fun SimpleXTheme(darkTheme: Boolean? = null, content: @Composable () -> Unit) { val theme by CurrentColors.collectAsState() MaterialTheme( colors = theme.colors, - typography = Typography, + typography = Typography.copy( + h1 = Typography.h1.copy(color = theme.colors.onBackground), + h2 = Typography.h2.copy(color = theme.colors.onBackground), + h3 = Typography.h3.copy(color = theme.colors.onBackground), + h4 = Typography.h4.copy(color = theme.colors.onBackground), + h5 = Typography.h5.copy(color = theme.colors.onBackground), + h6 = Typography.h6.copy(color = theme.colors.onBackground), + subtitle1 = Typography.subtitle1.copy(color = theme.colors.onBackground), + subtitle2 = Typography.subtitle2.copy(color = theme.colors.onBackground), + body1 = Typography.body1.copy(color = theme.colors.onBackground), + body2 = Typography.body2.copy(color = theme.colors.onBackground), + button = Typography.button.copy(color = theme.colors.onBackground), + caption = Typography.caption.copy(color = theme.colors.onBackground), + overline = Typography.overline.copy(color = theme.colors.onBackground) + ), shapes = Shapes, - content = content + content = { + ProvideTextStyle( + value = TextStyle(color = theme.colors.onBackground), + content = content + ) + } ) }