mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Channel appearance
This commit is contained in:
@@ -193,10 +193,14 @@ private final class ThemeGridThemeItemIconNode : ASDisplayNode {
|
||||
}
|
||||
|
||||
let string: String?
|
||||
if let _ = item.themeReference.emoticon {
|
||||
string = nil
|
||||
if let themeReference = item.themeReference {
|
||||
if let _ = themeReference.emoticon {
|
||||
string = nil
|
||||
} else {
|
||||
string = themeDisplayName(strings: item.strings, reference: themeReference)
|
||||
}
|
||||
} else {
|
||||
string = themeDisplayName(strings: item.strings, reference: item.themeReference)
|
||||
string = nil
|
||||
}
|
||||
|
||||
let text = NSAttributedString(string: string ?? item.strings.Conversation_Theme_NoTheme, font: Font.bold(14.0), textColor: .white)
|
||||
@@ -207,16 +211,17 @@ private final class ThemeGridThemeItemIconNode : ASDisplayNode {
|
||||
let (_, emojiApply) = makeEmojiLayout(TextNodeLayoutArguments(attributedString: title, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: size.width, height: CGFloat.greatestFiniteMagnitude), alignment: .center, cutout: nil, insets: UIEdgeInsets()))
|
||||
|
||||
if updatedThemeReference || updatedWallpaper || updatedNightMode || updatedSize {
|
||||
var themeReference = item.themeReference
|
||||
if case .builtin = themeReference, item.nightMode {
|
||||
themeReference = .builtin(.night)
|
||||
if var themeReference = item.themeReference {
|
||||
if case .builtin = themeReference, item.nightMode {
|
||||
themeReference = .builtin(.night)
|
||||
}
|
||||
|
||||
let color = item.themeSpecificAccentColors[themeReference.index]
|
||||
let wallpaper = item.themeSpecificChatWallpapers[themeReference.index]
|
||||
|
||||
self.imageNode.setSignal(themeIconImage(account: item.context.account, accountManager: item.context.sharedContext.accountManager, theme: themeReference, color: color, wallpaper: wallpaper ?? item.wallpaper, nightMode: item.nightMode, emoticon: true, large: true))
|
||||
self.imageNode.backgroundColor = nil
|
||||
}
|
||||
|
||||
let color = item.themeSpecificAccentColors[themeReference.index]
|
||||
let wallpaper = item.themeSpecificChatWallpapers[themeReference.index]
|
||||
|
||||
self.imageNode.setSignal(themeIconImage(account: item.context.account, accountManager: item.context.sharedContext.accountManager, theme: themeReference, color: color, wallpaper: wallpaper ?? item.wallpaper, nightMode: item.nightMode, emoticon: true, large: true))
|
||||
self.imageNode.backgroundColor = nil
|
||||
}
|
||||
|
||||
if updatedTheme || updatedSelected {
|
||||
@@ -501,7 +506,9 @@ class ThemeGridThemeItemNode: ListViewItemNode, ItemListItemNode {
|
||||
let selected = item.currentTheme.index == theme.index
|
||||
|
||||
let iconItem = ThemeCarouselThemeIconItem(context: item.context, emojiFile: theme.emoticon.flatMap { item.animatedEmojiStickers[$0]?.first?.file }, themeReference: theme, nightMode: item.nightMode, channelMode: false, themeSpecificAccentColors: item.themeSpecificAccentColors, themeSpecificChatWallpapers: item.themeSpecificChatWallpapers, selected: selected, theme: item.theme, strings: item.strings, wallpaper: nil, action: { theme in
|
||||
item.updatedTheme(theme)
|
||||
if let theme {
|
||||
item.updatedTheme(theme)
|
||||
}
|
||||
}, contextAction: nil)
|
||||
|
||||
validIds.append(theme.index)
|
||||
|
||||
Reference in New Issue
Block a user