Various theme improvements

This commit is contained in:
Ilya Laktyushin 2019-12-14 03:32:42 +04:00
parent eb406e4032
commit e19439a33e
37 changed files with 3981 additions and 3132 deletions

View file

@ -148,20 +148,33 @@ public final class CachedPatternWallpaperRepresentation: CachedMediaResourceRepr
public let keepDuration: CachedMediaRepresentationKeepDuration = .general
public let color: Int32
public let bottomColor: Int32?
public let intensity: Int32
public let rotation: Int32?
public var uniqueId: String {
return "pattern-wallpaper-\(self.color)-\(self.intensity)"
var id: String
if let bottomColor = self.bottomColor {
id = "pattern-wallpaper-\(self.color)-\(bottomColor)-\(self.intensity)"
} else {
id = "pattern-wallpaper-\(self.color)-\(self.intensity)"
}
if let rotation = self.rotation, rotation != 0 {
id += "-\(rotation)deg"
}
return id
}
public init(color: Int32, intensity: Int32) {
public init(color: Int32, bottomColor: Int32?, intensity: Int32, rotation: Int32?) {
self.color = color
self.bottomColor = bottomColor
self.intensity = intensity
self.rotation = rotation
}
public func isEqual(to: CachedMediaResourceRepresentation) -> Bool {
if let to = to as? CachedPatternWallpaperRepresentation {
return self.color == to.color && self.intensity == intensity
return self.color == to.color && self.bottomColor == to.bottomColor && self.intensity == intensity && self.rotation == to.rotation
} else {
return false
}