Fix tinted night preview

This commit is contained in:
Ali 2021-06-15 23:36:35 +04:00
parent 9da1b9566f
commit bac8b1efea

View File

@ -844,7 +844,14 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The
if let accentColor = accentColor, case let .theme(themeReference) = accentColor {
theme = makePresentationTheme(mediaBox: context.sharedContext.accountManager.mediaBox, themeReference: themeReference)
} else {
theme = makePresentationTheme(mediaBox: context.sharedContext.accountManager.mediaBox, themeReference: generalThemeReference, accentColor: accentColor?.accentColor, bubbleColors: accentColor?.customBubbleColors, wallpaper: accentColor?.wallpaper)
var wallpaperGradientColors: [UInt32]?
switch accentColor {
case let .accentColor(value):
wallpaperGradientColors = value.baseColor.wallpaperGradientColors
default:
break
}
theme = makePresentationTheme(mediaBox: context.sharedContext.accountManager.mediaBox, themeReference: generalThemeReference, accentColor: accentColor?.accentColor, bubbleColors: accentColor?.customBubbleColors, wallpaper: accentColor?.wallpaper, wallpaperGradientColors: wallpaperGradientColors)
}
effectiveWallpaper = theme?.chat.defaultWallpaper ?? .builtin(WallpaperSettings())
}