diff --git a/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift b/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift index 073e5dc584..4d6bb7998f 100644 --- a/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift +++ b/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift @@ -20,6 +20,12 @@ public func dateFillNeedsBlur(theme: PresentationTheme, wallpaper: TelegramWallp return false } else if case .color = wallpaper { return false + } else if case let .file(_, _, _, _, isPattern, _, _, _, settings) = wallpaper { + if isPattern, let intensity = settings.intensity, intensity < 0 { + return false + } else { + return true + } } else { return true } diff --git a/submodules/WallpaperBackgroundNode/Sources/WallpaperBackgroundNode.swift b/submodules/WallpaperBackgroundNode/Sources/WallpaperBackgroundNode.swift index f31444712a..794a687508 100644 --- a/submodules/WallpaperBackgroundNode/Sources/WallpaperBackgroundNode.swift +++ b/submodules/WallpaperBackgroundNode/Sources/WallpaperBackgroundNode.swift @@ -112,10 +112,14 @@ public final class WallpaperBackgroundNode: ASDisplayNode { needsCleanBackground = true } + var isInvertedGradient = false var hasComplexGradient = false switch wallpaper { case let .file(_, _, _, _, _, _, _, _, settings): hasComplexGradient = settings.colors.count >= 3 + if let intensity = settings.intensity, intensity < 0 { + isInvertedGradient = true + } case let .gradient(_, colors, _): hasComplexGradient = colors.count >= 3 default: @@ -125,6 +129,15 @@ public final class WallpaperBackgroundNode: ASDisplayNode { var needsGradientBackground = false var needsWallpaperBackground = false + if isInvertedGradient { + switch self.bubbleType { + case .free: + needsCleanBackground = false + case .incoming, .outgoing: + break + } + } + if needsCleanBackground { if hasComplexGradient { needsGradientBackground = backgroundNode.gradientBackgroundNode != nil