mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-17 02:11:57 +00:00
Update settings card background right away on theme switch
The section-card background (and its row dividers) were computed from a one-time read of the current theme, so after switching theme the card kept the old color until the screen was reopened, while the rows inside it updated correctly. Make the two color helpers observe the theme as state so the card recomposes on theme change like everything else. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8b537fbc3a
commit
514c0e8fb1
+4
-2
@@ -603,8 +603,9 @@ 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.
|
||||
@Composable
|
||||
fun canvasColorForCurrentTheme(): Color {
|
||||
val theme = CurrentColors.value
|
||||
val theme = CurrentColors.collectAsState().value
|
||||
val c = theme.colors
|
||||
return when (theme.base) {
|
||||
DefaultTheme.LIGHT -> c.background.mixWith(c.onBackground, 0.94f)
|
||||
@@ -616,8 +617,9 @@ fun canvasColorForCurrentTheme(): Color {
|
||||
// Card background color for SectionView. LIGHT: pure white (raised above the
|
||||
// off-white canvas). DARK/BLACK/SIMPLEX: founder's mixWith formula (lifts cards
|
||||
// above palette bg using onBackground tint).
|
||||
@Composable
|
||||
fun sectionCardColor(): Color {
|
||||
val theme = CurrentColors.value
|
||||
val theme = CurrentColors.collectAsState().value
|
||||
return if (theme.base == DefaultTheme.LIGHT) Color.White
|
||||
else theme.colors.background.mixWith(theme.colors.onBackground, 0.95f)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user