diff --git a/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift b/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift index 96c0501443..ccc7a13c8c 100644 --- a/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift +++ b/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift @@ -117,3 +117,17 @@ public extension NavigationControllerTheme { self.init(statusBar: navigationStatusBar, navigationBar: NavigationBarTheme(rootControllerTheme: presentationTheme), emptyAreaColor: presentationTheme.chatList.backgroundColor) } } + +public extension PresentationThemeBubbleColorComponents { + var hasSingleFillColor: Bool { + if self.fill.count == 1 { + return true + } + for i in 0 ..< self.fill.count - 1 { + if self.fill[i].argb != self.fill[i + 1].argb { + return false + } + } + return true + } +} diff --git a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChat.swift b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChat.swift index 652ebaee1a..21990f7bec 100644 --- a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChat.swift +++ b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChat.swift @@ -433,7 +433,7 @@ public struct PresentationResourcesChat { return generateImage(CGSize(width: 33.0, height: 33.0), rotatedContext: { size, context in context.clear(CGRect(origin: CGPoint(), size: size)) let color: UIColor - if [.day, .night].contains(theme.referenceTheme.baseTheme) && theme.chat.message.outgoing.bubble.withWallpaper.fill.count > 1 { + if [.day, .night].contains(theme.referenceTheme.baseTheme) && !theme.chat.message.outgoing.bubble.withWallpaper.hasSingleFillColor { color = .white } else { color = theme.chat.inputPanel.actionControlForegroundColor @@ -470,7 +470,7 @@ public struct PresentationResourcesChat { return generateImage(CGSize(width: 33.0, height: 33.0), rotatedContext: { size, context in context.clear(CGRect(origin: CGPoint(), size: size)) let color: UIColor - if [.day, .night].contains(theme.referenceTheme.baseTheme) && theme.chat.message.outgoing.bubble.withWallpaper.fill.count > 1 { + if [.day, .night].contains(theme.referenceTheme.baseTheme) && !theme.chat.message.outgoing.bubble.withWallpaper.hasSingleFillColor { color = .white } else { color = theme.chat.inputPanel.actionControlForegroundColor @@ -515,7 +515,7 @@ public struct PresentationResourcesChat { context.translateBy(x: -imageRect.midX, y: -imageRect.midY) let color: UIColor - if [.day, .night].contains(theme.referenceTheme.baseTheme) && theme.chat.message.outgoing.bubble.withWallpaper.fill.count > 1 { + if [.day, .night].contains(theme.referenceTheme.baseTheme) && !theme.chat.message.outgoing.bubble.withWallpaper.hasSingleFillColor { color = .white } else { color = theme.chat.inputPanel.actionControlForegroundColor diff --git a/submodules/TelegramUI/Sources/ChatTextInputActionButtonsNode.swift b/submodules/TelegramUI/Sources/ChatTextInputActionButtonsNode.swift index 20c23bd685..1509557639 100644 --- a/submodules/TelegramUI/Sources/ChatTextInputActionButtonsNode.swift +++ b/submodules/TelegramUI/Sources/ChatTextInputActionButtonsNode.swift @@ -42,6 +42,8 @@ final class ChatTextInputActionButtonsNode: ASDisplayNode { self.micButton = ChatTextInputMediaRecordingButton(theme: theme, strings: strings, presentController: presentController) self.sendContainerNode = ASDisplayNode() + self.sendContainerNode.layer.allowsGroupOpacity = true + self.backgroundNode = ASDisplayNode() self.backgroundNode.backgroundColor = theme.chat.inputPanel.actionControlFillColor self.backgroundNode.clipsToBounds = true @@ -112,7 +114,7 @@ final class ChatTextInputActionButtonsNode: ASDisplayNode { self.backgroundNode.backgroundColor = theme.chat.inputPanel.actionControlFillColor - if [.day, .night].contains(theme.referenceTheme.baseTheme) && theme.chat.message.outgoing.bubble.withWallpaper.fill.count > 1 { + if [.day, .night].contains(theme.referenceTheme.baseTheme) && !theme.chat.message.outgoing.bubble.withWallpaper.hasSingleFillColor { self.backdropNode.isHidden = false } else { self.backdropNode.isHidden = true