mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Theming improvements
This commit is contained in:
@@ -156,12 +156,15 @@ func uploadCustomWallpaper(context: AccountContext, wallpaper: WallpaperGalleryE
|
||||
|
||||
let _ = (updatePresentationThemeSettingsInteractively(accountManager: accountManager, { current in
|
||||
var themeSpecificChatWallpapers = current.themeSpecificChatWallpapers
|
||||
let themeReference: PresentationThemeReference
|
||||
if autoNightModeTriggered {
|
||||
themeSpecificChatWallpapers[current.automaticThemeSwitchSetting.theme.index] = wallpaper
|
||||
themeReference = current.automaticThemeSwitchSetting.theme
|
||||
} else {
|
||||
themeSpecificChatWallpapers[current.theme.index] = wallpaper
|
||||
themeReference = current.theme
|
||||
}
|
||||
return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations)
|
||||
let accentColorIndex = current.themeSpecificAccentColors[themeReference.index]?.index ?? 0
|
||||
themeSpecificChatWallpapers[themeReference.index &+ Int64(accentColorIndex)] = wallpaper
|
||||
return current.withUpdatedThemeSpecificChatWallpapers(themeSpecificChatWallpapers)
|
||||
})).start()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user