Replace legacy background with vector one

This commit is contained in:
Ilya Laktyushin
2023-03-09 23:52:56 +04:00
parent b39238c6db
commit 7fcce53b2c
7 changed files with 48 additions and 3 deletions

View File

@@ -383,7 +383,10 @@ public func currentPresentationDataAndSettings(accountManager: AccountManager<Te
let effectiveColors = themeSettings.themeSpecificAccentColors[effectiveTheme.index]
let theme = makePresentationTheme(mediaBox: accountManager.mediaBox, themeReference: effectiveTheme, baseTheme: preferredBaseTheme, accentColor: effectiveColors?.colorFor(baseTheme: preferredBaseTheme ?? .day), bubbleColors: effectiveColors?.customBubbleColors ?? [], baseColor: effectiveColors?.baseColor) ?? defaultPresentationTheme
let effectiveChatWallpaper: TelegramWallpaper = (themeSettings.themeSpecificChatWallpapers[coloredThemeIndex(reference: effectiveTheme, accentColor: effectiveColors)] ?? themeSettings.themeSpecificChatWallpapers[effectiveTheme.index]) ?? theme.chat.defaultWallpaper
var effectiveChatWallpaper: TelegramWallpaper = (themeSettings.themeSpecificChatWallpapers[coloredThemeIndex(reference: effectiveTheme, accentColor: effectiveColors)] ?? themeSettings.themeSpecificChatWallpapers[effectiveTheme.index]) ?? theme.chat.defaultWallpaper
if case .builtin = effectiveChatWallpaper {
effectiveChatWallpaper = defaultBuiltinWallpaper(data: .legacy, colors: legacyBuiltinWallpaperGradientColors.map(\.rgb))
}
let dateTimeFormat = currentDateTimeFormat()
let stringsValue: PresentationStrings
@@ -763,6 +766,10 @@ public func updatedPresentationData(accountManager: AccountManager<TelegramAccou
}
}
if case .builtin = effectiveChatWallpaper {
effectiveChatWallpaper = defaultBuiltinWallpaper(data: .legacy, colors: legacyBuiltinWallpaperGradientColors.map(\.rgb))
}
if let colors = effectiveColors, colors.baseColor == .theme {
effectiveColors = nil
}