UI and theme improvements

This commit is contained in:
Ali
2021-05-21 20:42:10 +04:00
parent 8557cd629a
commit a6f39e5a77
62 changed files with 1142 additions and 1208 deletions

View File

@@ -189,10 +189,9 @@ final class WallpaperPatternPanelNode: ASDisplayNode {
}
}
var backgroundColors: (UIColor, UIColor?, Int32?)? = nil {
var backgroundColors: ([UInt32], Int32?)? = nil {
didSet {
if oldValue?.0.rgb != self.backgroundColors?.0.rgb || oldValue?.1?.rgb != self.backgroundColors?.1?.rgb
|| oldValue?.2 != self.backgroundColors?.2 {
if oldValue?.0 != self.backgroundColors?.0 || oldValue?.1 != self.backgroundColors?.1 {
self.updateWallpapers()
}
}
@@ -285,7 +284,7 @@ final class WallpaperPatternPanelNode: ASDisplayNode {
node.removeFromSupernode()
}
let backgroundColors = self.backgroundColors ?? (UIColor(rgb: 0xd6e2ee), nil, nil)
let backgroundColors = self.backgroundColors ?? ([0xd6e2ee], nil)
var selectedFileId: Int64?
if let currentWallpaper = self.currentWallpaper, case let .file(file) = currentWallpaper {
@@ -299,7 +298,7 @@ final class WallpaperPatternPanelNode: ASDisplayNode {
var updatedWallpaper = wallpaper
if case let .file(file) = updatedWallpaper {
let settings = WallpaperSettings(color: backgroundColors.0.rgb, bottomColor: backgroundColors.1.flatMap { $0.rgb }, intensity: 100, rotation: backgroundColors.2)
let settings = WallpaperSettings(colors: backgroundColors.0, intensity: 100, rotation: backgroundColors.1)
updatedWallpaper = .file(id: file.id, accessHash: file.accessHash, isCreator: file.isCreator, isDefault: file.isDefault, isPattern: updatedWallpaper.isPattern, isDark: file.isDark, slug: file.slug, file: file.file, settings: settings)
}