Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios

This commit is contained in:
Ilya Laktyushin 2021-06-15 20:33:20 +03:00
commit cbd7b5d106
2 changed files with 8 additions and 3 deletions

View File

@ -470,7 +470,7 @@ final class ThemeAccentColorController: ViewController {
} else if let customWallpaper = settings.themeSpecificChatWallpapers[themeReference.index] {
wallpaper = customWallpaper
} else {
let theme = makePresentationTheme(mediaBox: strongSelf.context.sharedContext.accountManager.mediaBox, themeReference: themeReference, accentColor: themeSpecificAccentColor?.color, wallpaper: themeSpecificAccentColor?.wallpaper) ?? defaultPresentationTheme
let theme = makePresentationTheme(mediaBox: strongSelf.context.sharedContext.accountManager.mediaBox, themeReference: themeReference, accentColor: themeSpecificAccentColor?.color, wallpaper: themeSpecificAccentColor?.wallpaper, wallpaperGradientColors: themeSpecificAccentColor?.baseColor.wallpaperGradientColors) ?? defaultPresentationTheme
referenceTheme = theme
wallpaper = theme.chat.defaultWallpaper
}

View File

@ -1047,10 +1047,15 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The
var defaultThemes: [PresentationThemeReference] = []
if presentationData.autoNightModeTriggered {
defaultThemes.append(contentsOf: [.builtin(.nightAccent), .builtin(.night)])
} else {
defaultThemes.append(contentsOf: [.builtin(.dayClassic), .builtin(.day)])
defaultThemes.append(contentsOf: [
.builtin(.dayClassic),
.builtin(.nightAccent),
.builtin(.day),
.builtin(.night)
])
}
defaultThemes.append(contentsOf: [.builtin(.night), .builtin(.nightAccent)])
let cloudThemes: [PresentationThemeReference] = cloudThemes.map { .cloud(PresentationCloudTheme(theme: $0, resolvedWallpaper: nil, creatorAccountId: $0.isCreator ? context.account.id : nil)) }.filter { !removedThemeIndexes.contains($0.index) }