Fix night accent colors

This commit is contained in:
Ali
2021-06-15 21:06:04 +04:00
parent 448e96c175
commit 74a9c159d7
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) }