Update themes

This commit is contained in:
Ilya Laktyushin
2019-12-24 23:03:40 +03:00
parent efacf13a9e
commit e27d764dae
33 changed files with 1396 additions and 789 deletions

View File

@@ -456,6 +456,7 @@ public struct PresentationThemeAccentColor: PostboxCoding, Equatable {
} else {
self.bubbleColors = nil
}
self.wallpaper = decoder.decodeObjectForKey("w", decoder: { TelegramWallpaper(decoder: $0) }) as? TelegramWallpaper
}
public func encode(_ encoder: PostboxEncoder) {
@@ -477,6 +478,11 @@ public struct PresentationThemeAccentColor: PostboxCoding, Equatable {
encoder.encodeNil(forKey: "bt")
encoder.encodeNil(forKey: "bb")
}
if let wallpaper = self.wallpaper {
encoder.encodeObject(wallpaper, forKey: "w")
} else {
encoder.encodeNil(forKey: "w")
}
}
public var color: UIColor {
@@ -510,6 +516,10 @@ public struct PresentationThemeAccentColor: PostboxCoding, Equatable {
return nil
}
}
public func withUpdatedWallpaper(_ wallpaper: TelegramWallpaper?) -> PresentationThemeAccentColor {
return PresentationThemeAccentColor(index: self.index, baseColor: self.baseColor, accentColor: self.accentColor, bubbleColors: self.bubbleColors, wallpaper: wallpaper)
}
}
public struct PresentationThemeSettings: PreferencesEntry {