diff --git a/submodules/SettingsUI/Sources/Themes/ThemeSettingsThemeItem.swift b/submodules/SettingsUI/Sources/Themes/ThemeSettingsThemeItem.swift index 0f0e66df62..f4c991b813 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeSettingsThemeItem.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeSettingsThemeItem.swift @@ -249,11 +249,15 @@ private final class ThemeSettingsThemeItemIconNode : ListViewItemNode { var updatedThemeReference = false var updatedAccentColor = false var updatedTheme = false + var updatedWallpaper = false var updatedSelected = false if currentItem?.themeReference != item.themeReference { updatedThemeReference = true } + if currentItem?.wallpaper != item.wallpaper { + updatedWallpaper = true + } if currentItem == nil || currentItem?.accentColor != item.accentColor { updatedAccentColor = true } @@ -278,7 +282,7 @@ private final class ThemeSettingsThemeItemIconNode : ListViewItemNode { } strongSelf.containerNode.isGestureEnabled = false } else { - if updatedThemeReference || updatedAccentColor { + if updatedThemeReference || updatedAccentColor || updatedWallpaper { strongSelf.imageNode.setSignal(themeIconImage(account: item.context.account, accountManager: item.context.sharedContext.accountManager, theme: item.themeReference, color: item.accentColor, wallpaper: item.wallpaper)) } strongSelf.containerNode.isGestureEnabled = true @@ -545,8 +549,6 @@ class ThemeSettingsThemeItemNode: ListViewItemNode, ItemListItemNode { return (layout, { [weak self] in if let strongSelf = self { - let isFirstLayout = currentItem == nil - strongSelf.item = item strongSelf.layoutParams = params @@ -636,14 +638,15 @@ class ThemeSettingsThemeItemNode: ListViewItemNode, ItemListItemNode { let customWallpaper = item.themeSpecificChatWallpapers[theme.generalThemeReference.index] let wallpaper = accentColor?.wallpaper ?? customWallpaper ?? themeWallpaper + entries.append(ThemeSettingsThemeEntry(index: index, themeReference: theme, title: title, accentColor: accentColor, selected: item.currentTheme.index == theme.index, theme: item.theme, wallpaper: wallpaper)) index += 1 } - let action: (PresentationThemeReference) -> Void = { [weak self, weak item] themeReference in + let action: (PresentationThemeReference) -> Void = { [weak self] themeReference in if let strongSelf = self { strongSelf.item?.updatedTheme(themeReference) - ensureThemeVisible(listNode: strongSelf.listNode, themeReference: themeReference, animated: true) + let _ = ensureThemeVisible(listNode: strongSelf.listNode, themeReference: themeReference, animated: true) } } let previousEntries = strongSelf.entries ?? [] diff --git a/submodules/TelegramCallsUI/Sources/CallStatusBarNode.swift b/submodules/TelegramCallsUI/Sources/CallStatusBarNode.swift index 9bbdc61664..f02ecdc0ad 100644 --- a/submodules/TelegramCallsUI/Sources/CallStatusBarNode.swift +++ b/submodules/TelegramCallsUI/Sources/CallStatusBarNode.swift @@ -138,6 +138,7 @@ private class CallStatusBarBackgroundNode: ASDisplayNode { } private func setupGradientAnimations() { + return if let _ = self.foregroundGradientLayer.animation(forKey: "movement") { } else { let previousValue = self.foregroundGradientLayer.startPoint diff --git a/submodules/TelegramCallsUI/Sources/VoiceChatTileItemNode.swift b/submodules/TelegramCallsUI/Sources/VoiceChatTileItemNode.swift index 9d0d120d2c..9fef829ff6 100644 --- a/submodules/TelegramCallsUI/Sources/VoiceChatTileItemNode.swift +++ b/submodules/TelegramCallsUI/Sources/VoiceChatTileItemNode.swift @@ -328,7 +328,6 @@ final class VoiceChatTileItemNode: ASDisplayNode { } let titleFont = Font.semibold(13.0) - let subtitleFont = Font.regular(13.0) let titleColor = UIColor.white var titleAttributedString: NSAttributedString? if let user = item.peer as? TelegramUser { diff --git a/submodules/WallpaperResources/Sources/WallpaperResources.swift b/submodules/WallpaperResources/Sources/WallpaperResources.swift index 63fd491f45..4768846afe 100644 --- a/submodules/WallpaperResources/Sources/WallpaperResources.swift +++ b/submodules/WallpaperResources/Sources/WallpaperResources.swift @@ -1130,7 +1130,7 @@ public func themeImage(account: Account, accountManager: AccountManager, source: public func themeIconImage(account: Account, accountManager: AccountManager, theme: PresentationThemeReference, color: PresentationThemeAccentColor?, wallpaper: TelegramWallpaper? = nil) -> Signal<(TransformImageArguments) -> DrawingContext?, NoError> { let colorsSignal: Signal<((UIColor, UIColor?, [UInt32]), (UIColor, UIColor), (UIColor, UIColor), UIImage?, Int32?), NoError> - if case let .builtin(theme) = theme { + if false, case let .builtin(theme) = theme { let incomingColor: UIColor let outgoingColor: (UIColor, UIColor) var accentColor = color?.color @@ -1242,9 +1242,11 @@ public func themeIconImage(account: Account, accountManager: AccountManager, the } else if case let .cloud(theme) = theme, let resource = theme.theme.file?.resource { reference = .theme(theme: .slug(theme.theme.slug), resource: resource) } - + let themeSignal: Signal - if case let .cloud(theme) = theme, let settings = theme.theme.settings { + if case let .builtin(theme) = theme { + themeSignal = .single(makeDefaultPresentationTheme(reference: theme, serviceBackgroundColor: nil)) + } else if case let .cloud(theme) = theme, let settings = theme.theme.settings { themeSignal = Signal { subscriber in let theme = makePresentationTheme(mediaBox: accountManager.mediaBox, themeReference: .builtin(PresentationBuiltinThemeReference(baseTheme: settings.baseTheme)), accentColor: UIColor(argb: settings.accentColor), backgroundColors: [], bubbleColors: settings.messageColors.flatMap { (UIColor(argb: $0.top), UIColor(argb: $0.bottom)) }, wallpaper: settings.wallpaper, serviceBackgroundColor: nil, preview: false) subscriber.putNext(theme) @@ -1273,7 +1275,8 @@ public func themeIconImage(account: Account, accountManager: AccountManager, the var backgroundColor: (UIColor, UIColor?, [UInt32]) let incomingColor = (theme.chat.message.incoming.bubble.withoutWallpaper.fill, theme.chat.message.incoming.bubble.withoutWallpaper.gradientFill) let outgoingColor = (theme.chat.message.outgoing.bubble.withoutWallpaper.fill, theme.chat.message.outgoing.bubble.withoutWallpaper.gradientFill) - switch theme.chat.defaultWallpaper { + let wallpaper = wallpaper ?? theme.chat.defaultWallpaper + switch wallpaper { case .builtin: backgroundColor = (UIColor(rgb: 0xd6e2ee), nil, []) case let .color(color):