diff --git a/submodules/SettingsUI/Sources/Themes/ThemeGridControllerNode.swift b/submodules/SettingsUI/Sources/Themes/ThemeGridControllerNode.swift index 0e5c284b63..279e96d0f5 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeGridControllerNode.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeGridControllerNode.swift @@ -375,6 +375,16 @@ final class ThemeGridControllerNode: ASDisplayNode { sortedWallpapers = wallpapers.map(\.wallpaper) } + if let builtinIndex = sortedWallpapers.firstIndex(where: { wallpaper in + if case .builtin = wallpaper { + return true + } else { + return false + } + }) { + sortedWallpapers[builtinIndex] = defaultBuiltinWallpaper(data: .legacy, colors: legacyBuiltinWallpaperGradientColors.map(\.rgb)) + } + for wallpaper in sortedWallpapers { if case let .file(file) = wallpaper, (wallpaper.isPattern && file.settings.colors.isEmpty) { continue diff --git a/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift b/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift index 547edd2235..1233f97cc9 100644 --- a/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift +++ b/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift @@ -1049,6 +1049,10 @@ public func makeDefaultDayPresentationTheme(extendingThemeReference: Presentatio ) } +public let legacyBuiltinWallpaperGradientColors: [UIColor] = [ + UIColor(rgb: 0xd6e2ee) +] + public let defaultBuiltinWallpaperGradientColors: [UIColor] = [ UIColor(rgb: 0xdbddbb), UIColor(rgb: 0x6ba587), @@ -1076,6 +1080,15 @@ public extension BuiltinWallpaperData { datacenterId: 4, fileSize: 183832 ) + static let legacy = BuiltinWallpaperData( + wallpaperId: 5911458201550716931, + wallpaperAccessHash: -5164387148619674119, + slug: "Ye7DfT2kCVIKAAAAhzXfrkdOjxs", + fileId: 5911315028815907420, + fileAccessHash: 5205407890340371688, + datacenterId: 2, + fileSize: 71715 + ) static let variant1 = BuiltinWallpaperData( wallpaperId: 5784984711902265347, wallpaperAccessHash: -7073897034484875424, @@ -1206,6 +1219,7 @@ public extension BuiltinWallpaperData { static func generate(account: Account) { let slugToName: [(String, String)] = [ ("fqv01SQemVIBAAAApND8LDRUhRU", "`default`"), + ("Ye7DfT2kCVIKAAAAhzXfrkdOjxs", "legacy"), ("RlZs2PJkSFADAAAAElGaGwgJBgU", "variant1"), ("9LW_RcoOSVACAAAAFTk3DTyXN-M", "variant2"), ("CJNyxPMgSVAEAAAAvW9sMwc51cw", "variant3"), diff --git a/submodules/TelegramPresentationData/Sources/PresentationData.swift b/submodules/TelegramPresentationData/Sources/PresentationData.swift index f38ec45828..3458593c55 100644 --- a/submodules/TelegramPresentationData/Sources/PresentationData.swift +++ b/submodules/TelegramPresentationData/Sources/PresentationData.swift @@ -383,7 +383,10 @@ public func currentPresentationDataAndSettings(accountManager: AccountManager AccountAu } } else if let wallpaperResource = resource as? WallpaperDataResource { let builtinWallpapers: [String] = [ - "fqv01SQemVIBAAAApND8LDRUhRU" + "fqv01SQemVIBAAAApND8LDRUhRU", + "Ye7DfT2kCVIKAAAAhzXfrkdOjxs" ] if builtinWallpapers.contains(wallpaperResource.slug) { if let url = getAppBundle().url(forResource: wallpaperResource.slug, withExtension: "tgv") { @@ -67,6 +68,19 @@ func makeTelegramAccountAuxiliaryMethods(appDelegate: AppDelegate?) -> AccountAu } else { return nil } + } else if cloudDocumentMediaResource.fileId == 5911315028815907420 { + if let url = getAppBundle().url(forResource: "Ye7DfT2kCVIKAAAAhzXfrkdOjxs", withExtension: "tgv") { + return Signal { subscriber in + subscriber.putNext(.reset) + if let data = try? Data(contentsOf: url, options: .mappedRead) { + subscriber.putNext(.dataPart(resourceOffset: 0, data: data, range: 0 ..< Int64(data.count), complete: true)) + } + + return EmptyDisposable + } + } else { + return nil + } } } else if let cloudDocumentSizeMediaResource = resource as? CloudDocumentSizeMediaResource { if cloudDocumentSizeMediaResource.documentId == 5789658100176783156 && cloudDocumentSizeMediaResource.sizeSpec == "m" { diff --git a/submodules/WallpaperBackgroundNode/Sources/WallpaperBackgroundNode.swift b/submodules/WallpaperBackgroundNode/Sources/WallpaperBackgroundNode.swift index c1f84f03dc..441086cb9a 100644 --- a/submodules/WallpaperBackgroundNode/Sources/WallpaperBackgroundNode.swift +++ b/submodules/WallpaperBackgroundNode/Sources/WallpaperBackgroundNode.swift @@ -1035,7 +1035,7 @@ final class WallpaperBackgroundNodeImpl: ASDisplayNode, WallpaperBackgroundNode if patternIsBlack { self.patternImageLayer.softlightMode = .never } else { - if self.useSharedAnimationPhase { + if self.useSharedAnimationPhase && file.settings.colors.count > 2 { self.patternImageLayer.softlightMode = .whileAnimating } else { self.patternImageLayer.softlightMode = .always