mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-15 18:59:54 +00:00
Theme fixes
This commit is contained in:
parent
b97b7a3aae
commit
f88599d66a
@ -609,7 +609,7 @@ class ThemeSettingsThemeItemNode: ListViewItemNode, ItemListItemNode {
|
||||
|
||||
var entries: [ThemeSettingsThemeEntry] = []
|
||||
var index: Int = 0
|
||||
for var theme in item.themes.prefix(1) {
|
||||
for var theme in item.themes {
|
||||
if !item.displayUnsupported, case let .cloud(theme) = theme, theme.theme.file == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
@ -1163,7 +1163,15 @@ public func themeIconImage(account: Account, accountManager: AccountManager, the
|
||||
}
|
||||
|
||||
let themeSignal: Signal<PresentationTheme?, NoError>
|
||||
if let reference = reference {
|
||||
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: UInt32(bitPattern: settings.accentColor)), backgroundColors: nil, bubbleColors: settings.messageColors.flatMap { (UIColor(argb: UInt32(bitPattern: $0.top)), UIColor(argb: UInt32(bitPattern: $0.bottom))) }, wallpaper: settings.wallpaper, serviceBackgroundColor: nil, preview: false)
|
||||
subscriber.putNext(theme)
|
||||
subscriber.putCompletion()
|
||||
|
||||
return EmptyDisposable
|
||||
}
|
||||
} else if let reference = reference {
|
||||
themeSignal = telegramThemeData(account: account, accountManager: accountManager, reference: reference, synchronousLoad: false)
|
||||
|> map { data -> PresentationTheme? in
|
||||
if let data = data, let theme = makePresentationTheme(data: data) {
|
||||
@ -1172,14 +1180,6 @@ public func themeIconImage(account: Account, accountManager: AccountManager, the
|
||||
return 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: UInt32(bitPattern: settings.accentColor)), backgroundColors: nil, bubbleColors: settings.messageColors.flatMap { (UIColor(argb: UInt32(bitPattern: $0.top)), UIColor(argb: UInt32(bitPattern: $0.bottom))) }, wallpaper: settings.wallpaper, serviceBackgroundColor: nil, preview: false)
|
||||
subscriber.putNext(theme)
|
||||
subscriber.putCompletion()
|
||||
|
||||
return EmptyDisposable
|
||||
}
|
||||
} else {
|
||||
themeSignal = .never()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user