Merge commit '667aec4df01e39fbe184a30e3ed92408c45a6fd2' into beta

This commit is contained in:
Ali 2021-09-21 18:50:29 +03:00
commit c315e84d5e
3 changed files with 20 additions and 4 deletions

View File

@ -117,3 +117,17 @@ public extension NavigationControllerTheme {
self.init(statusBar: navigationStatusBar, navigationBar: NavigationBarTheme(rootControllerTheme: presentationTheme), emptyAreaColor: presentationTheme.chatList.backgroundColor) 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
}
}

View File

@ -433,7 +433,7 @@ public struct PresentationResourcesChat {
return generateImage(CGSize(width: 33.0, height: 33.0), rotatedContext: { size, context in return generateImage(CGSize(width: 33.0, height: 33.0), rotatedContext: { size, context in
context.clear(CGRect(origin: CGPoint(), size: size)) context.clear(CGRect(origin: CGPoint(), size: size))
let color: UIColor 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 color = .white
} else { } else {
color = theme.chat.inputPanel.actionControlForegroundColor 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 return generateImage(CGSize(width: 33.0, height: 33.0), rotatedContext: { size, context in
context.clear(CGRect(origin: CGPoint(), size: size)) context.clear(CGRect(origin: CGPoint(), size: size))
let color: UIColor 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 color = .white
} else { } else {
color = theme.chat.inputPanel.actionControlForegroundColor color = theme.chat.inputPanel.actionControlForegroundColor
@ -515,7 +515,7 @@ public struct PresentationResourcesChat {
context.translateBy(x: -imageRect.midX, y: -imageRect.midY) context.translateBy(x: -imageRect.midX, y: -imageRect.midY)
let color: UIColor 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 color = .white
} else { } else {
color = theme.chat.inputPanel.actionControlForegroundColor color = theme.chat.inputPanel.actionControlForegroundColor

View File

@ -42,6 +42,8 @@ final class ChatTextInputActionButtonsNode: ASDisplayNode {
self.micButton = ChatTextInputMediaRecordingButton(theme: theme, strings: strings, presentController: presentController) self.micButton = ChatTextInputMediaRecordingButton(theme: theme, strings: strings, presentController: presentController)
self.sendContainerNode = ASDisplayNode() self.sendContainerNode = ASDisplayNode()
self.sendContainerNode.layer.allowsGroupOpacity = true
self.backgroundNode = ASDisplayNode() self.backgroundNode = ASDisplayNode()
self.backgroundNode.backgroundColor = theme.chat.inputPanel.actionControlFillColor self.backgroundNode.backgroundColor = theme.chat.inputPanel.actionControlFillColor
self.backgroundNode.clipsToBounds = true self.backgroundNode.clipsToBounds = true
@ -112,7 +114,7 @@ final class ChatTextInputActionButtonsNode: ASDisplayNode {
self.backgroundNode.backgroundColor = theme.chat.inputPanel.actionControlFillColor 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 self.backdropNode.isHidden = false
} else { } else {
self.backdropNode.isHidden = true self.backdropNode.isHidden = true