mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Cloud Themes wallpapers improvements
This commit is contained in:
@@ -10,6 +10,7 @@ import TelegramUIPreferences
|
||||
import AccountContext
|
||||
import ShareController
|
||||
import CounterContollerTitleView
|
||||
import WallpaperResources
|
||||
|
||||
public enum ThemePreviewSource {
|
||||
case theme(TelegramTheme)
|
||||
@@ -22,6 +23,7 @@ public final class ThemePreviewController: ViewController {
|
||||
private let previewTheme: PresentationTheme
|
||||
private let source: ThemePreviewSource
|
||||
private let theme = Promise<TelegramTheme?>()
|
||||
private let wallpaper = Promise<TelegramWallpaper>()
|
||||
|
||||
private var controllerNode: ThemePreviewControllerNode {
|
||||
return self.displayNode as! ThemePreviewControllerNode
|
||||
@@ -57,6 +59,15 @@ public final class ThemePreviewController: ViewController {
|
||||
themeName = previewTheme.name.string
|
||||
}
|
||||
|
||||
if case let .file(file) = previewTheme.chat.defaultWallpaper, file.id == 0 {
|
||||
self.wallpaper.set(cachedWallpaper(account: context.account, slug: file.slug)
|
||||
|> mapToSignal { wallpaper in
|
||||
return .single(wallpaper?.wallpaper ?? .color(Int32(bitPattern: previewTheme.chatList.backgroundColor.rgb)))
|
||||
})
|
||||
} else {
|
||||
self.wallpaper.set(.single(previewTheme.chat.defaultWallpaper))
|
||||
}
|
||||
|
||||
if let author = previewTheme.author {
|
||||
let titleView = CounterContollerTitleView(theme: self.previewTheme)
|
||||
titleView.title = CounterContollerTitle(title: themeName, counter: author)
|
||||
|
||||
Reference in New Issue
Block a user