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 b70746db86..cfa7576f56 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 @@ -603,6 +603,13 @@ data class ThemeModeOverride ( // cards above. DARK/BLACK: palette bg (cards already raised via founder's // formula in Section.kt). SIMPLEX: gradient bottom stop (darker), since the // canvas itself is a gradient drawn by themedBackgroundBrush. +// +// Reads CurrentColors.value directly rather than via MaterialTheme/CompositionLocal +// because this helper is called from two scopes: @Composable bodies (SectionView, +// SectionDivider) and DrawScope (sectionItemDivider's drawWithContent). DrawScope +// can't call @Composable getters, so a snapshot read keeps one helper usable in +// both places. State invalidation still works — CurrentColors is a MutableStateFlow, +// reads are tracked by Compose snapshot system. fun canvasColorForCurrentTheme(): Color { val theme = CurrentColors.value val c = theme.colors