Use right colors on ForcedDarkElementTheme

This commit is contained in:
Benoit Marty 2025-10-22 09:48:07 +02:00
parent 07b9a8456b
commit 5720b2df1a
6 changed files with 43 additions and 4 deletions

View file

@ -16,6 +16,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import io.element.android.compound.colors.SemanticColorsLightDark
/**
* Can be used to force a composable in dark theme.
@ -23,6 +24,7 @@ import androidx.compose.ui.graphics.toArgb
*/
@Composable
fun ForcedDarkElementTheme(
colors: SemanticColorsLightDark,
lightStatusBar: Boolean = false,
content: @Composable () -> Unit,
) {
@ -47,5 +49,11 @@ fun ForcedDarkElementTheme(
)
}
}
ElementTheme(darkTheme = true, lightStatusBar = lightStatusBar, content = content)
ElementTheme(
darkTheme = true,
compoundLight = colors.light,
compoundDark = colors.dark,
lightStatusBar = lightStatusBar,
content = content,
)
}