Implemented chat-specific themes

This commit is contained in:
Ilya Laktyushin
2021-08-22 18:30:49 +03:00
parent c7fe52fd72
commit d423f90681
63 changed files with 1649 additions and 234 deletions

View File

@@ -559,7 +559,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
private let clientId: Atomic<Int32>
public init(context: AccountContext, chatLocation: ChatLocation, chatLocationContextHolder: Atomic<ChatLocationContextHolder?>, tagMask: MessageTags?, source: ChatHistoryListSource = .default, subject: ChatControllerSubject?, controllerInteraction: ChatControllerInteraction, selectedMessages: Signal<Set<MessageId>?, NoError>, mode: ChatHistoryListMode = .bubbles, messageTransitionNode: @escaping () -> ChatMessageTransitionNode? = { nil }) {
public init(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>), chatLocation: ChatLocation, chatLocationContextHolder: Atomic<ChatLocationContextHolder?>, tagMask: MessageTags?, source: ChatHistoryListSource = .default, subject: ChatControllerSubject?, controllerInteraction: ChatControllerInteraction, selectedMessages: Signal<Set<MessageId>?, NoError>, mode: ChatHistoryListMode = .bubbles, messageTransitionNode: @escaping () -> ChatMessageTransitionNode? = { nil }) {
var tagMask = tagMask
var appendMessagesFromTheSameGroup = false
if case .pinnedMessages = subject {
@@ -575,7 +575,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
self.controllerInteraction = controllerInteraction
self.mode = mode
let presentationData = context.sharedContext.currentPresentationData.with { $0 }
let presentationData = updatedPresentationData.initial
self.currentPresentationData = ChatPresentationData(theme: ChatPresentationThemeData(theme: presentationData.theme, wallpaper: presentationData.chatWallpaper), fontSize: presentationData.chatFontSize, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameDisplayOrder: presentationData.nameDisplayOrder, disableAnimations: true, largeEmoji: presentationData.largeEmoji, chatBubbleCorners: presentationData.chatBubbleCorners, animatedEmojiScale: 1.0)
self.chatPresentationDataPromise = Promise(self.currentPresentationData)
@@ -1088,7 +1088,7 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
self.presentationDataDisposable = (
combineLatest(queue: .mainQueue(),
context.sharedContext.presentationData,
updatedPresentationData.signal,
appConfiguration)
|> deliverOnMainQueue).start(next: { [weak self] presentationData, appConfiguration in
if let strongSelf = self {