fix toolbar

This commit is contained in:
Evgeny @ SimpleX Chat
2026-05-20 18:34:01 +00:00
parent e92278c658
commit ec1f4084f7
2 changed files with 5 additions and 3 deletions
@@ -622,10 +622,12 @@ fun sectionCardColor(): Color {
else theme.colors.background.mixWith(theme.colors.onBackground, 0.95f)
}
fun Modifier.themedBackground(baseTheme: DefaultTheme = CurrentColors.value.base, bgLayerSize: MutableState<IntSize>?, bgLayer: GraphicsLayer?/*, shape: Shape = RectangleShape*/): Modifier {
fun Modifier.themedBackground(baseTheme: DefaultTheme = CurrentColors.value.base, bgLayerSize: MutableState<IntSize>?, bgLayer: GraphicsLayer?, overrideColor: Color? = null): Modifier {
return drawBehind {
copyBackgroundToAppBar(bgLayerSize, bgLayer) {
if (baseTheme == DefaultTheme.SIMPLEX) {
if (overrideColor != null) {
drawRect(overrideColor)
} else if (baseTheme == DefaultTheme.SIMPLEX) {
drawRect(brush = themedBackgroundBrush())
} else {
drawRect(CurrentColors.value.colors.background)
@@ -40,7 +40,7 @@ fun ModalView(
}
val oneHandUI = remember { derivedStateOf { if (appPrefs.onboardingStage.state.value == OnboardingStage.OnboardingComplete) appPrefs.oneHandUI.state.value else false } }
Surface(Modifier.fillMaxSize(), contentColor = LocalContentColor.current) {
Box(if (background != Color.Unspecified) Modifier.background(background) else Modifier.themedBackground(bgLayerSize = LocalAppBarHandler.current?.backgroundGraphicsLayerSize, bgLayer = LocalAppBarHandler.current?.backgroundGraphicsLayer)) {
Box(Modifier.themedBackground(bgLayerSize = LocalAppBarHandler.current?.backgroundGraphicsLayerSize, bgLayer = LocalAppBarHandler.current?.backgroundGraphicsLayer, overrideColor = if (background != Color.Unspecified) background else null)) {
Box(modifier = modifier) {
content()
}