Allow disabling service message blur for certain wallpapers

This commit is contained in:
Ali 2021-06-11 15:19:52 +04:00
parent 4ef4eca926
commit dc31b6e3d8
25 changed files with 59 additions and 54 deletions

View File

@ -121,15 +121,8 @@ private var sharedIsReduceTransparencyEnabled = UIAccessibility.isReduceTranspar
public final class NavigationBackgroundNode: ASDisplayNode {
private var _color: UIColor
public var color: UIColor {
get {
return self._color
} set(value) {
self.updateColor(color: value, transition: .immediate)
}
}
private let enableBlur: Bool
private var enableBlur: Bool
private var effectView: UIVisualEffectView?
private let backgroundNode: ASDisplayNode
@ -150,7 +143,7 @@ public final class NavigationBackgroundNode: ASDisplayNode {
}
private func updateBackgroundBlur(forceKeepBlur: Bool) {
if self.enableBlur && !sharedIsReduceTransparencyEnabled && ((self.color.alpha > .ulpOfOne && self.color.alpha < 0.95) || forceKeepBlur) {
if self.enableBlur && !sharedIsReduceTransparencyEnabled && ((self._color.alpha > .ulpOfOne && self._color.alpha < 0.95) || forceKeepBlur) {
if self.effectView == nil {
let effectView = UIVisualEffectView(effect: UIBlurEffect(style: .light))
@ -193,16 +186,19 @@ public final class NavigationBackgroundNode: ASDisplayNode {
}
}
public func updateColor(color: UIColor, forceKeepBlur: Bool = false, transition: ContainedViewLayoutTransition) {
if self._color.isEqual(color) {
public func updateColor(color: UIColor, enableBlur: Bool? = nil, forceKeepBlur: Bool = false, transition: ContainedViewLayoutTransition) {
let effectiveEnableBlur = enableBlur ?? self.enableBlur
if self._color.isEqual(color) && self.enableBlur == effectiveEnableBlur {
return
}
self._color = color
self.enableBlur = effectiveEnableBlur
if sharedIsReduceTransparencyEnabled {
transition.updateBackgroundColor(node: self.backgroundNode, color: self.color.withAlphaComponent(1.0))
transition.updateBackgroundColor(node: self.backgroundNode, color: self._color.withAlphaComponent(1.0))
} else {
transition.updateBackgroundColor(node: self.backgroundNode, color: self.color)
transition.updateBackgroundColor(node: self.backgroundNode, color: self._color)
}
self.updateBackgroundBlur(forceKeepBlur: forceKeepBlur)
@ -906,7 +902,7 @@ open class NavigationBar: ASDisplayNode {
if presentationData.theme !== self.presentationData.theme || presentationData.strings !== self.presentationData.strings {
self.presentationData = presentationData
self.backgroundNode.color = self.presentationData.theme.backgroundColor
self.backgroundNode.updateColor(color: self.presentationData.theme.backgroundColor, transition: .immediate)
self.backButtonNode.color = self.presentationData.theme.buttonColor
self.backButtonNode.disabledColor = self.presentationData.theme.disabledButtonColor

View File

@ -393,7 +393,7 @@ class TabBarNode: ASDisplayNode {
self.theme = theme
self.separatorNode.backgroundColor = theme.tabBarSeparatorColor
self.backgroundNode.color = theme.tabBarBackgroundColor
self.backgroundNode.updateColor(color: theme.tabBarBackgroundColor, transition: .immediate)
self.badgeImage = generateStretchableFilledCircleImage(diameter: 18.0, color: theme.tabBarBadgeBackgroundColor, strokeColor: theme.tabBarBadgeStrokeColor, strokeWidth: 1.0, backgroundColor: nil)!
for container in self.tabBarNodeContainers {

View File

@ -102,7 +102,7 @@ public final class ToolbarNode: ASDisplayNode {
public func updateTheme(_ theme: TabBarControllerTheme) {
self.separatorNode.backgroundColor = theme.tabBarSeparatorColor
self.backgroundNode.color = theme.tabBarBackgroundColor
self.backgroundNode.updateColor(color: theme.tabBarBackgroundColor, transition: .immediate)
}
public func updateLayout(size: CGSize, leftInset: CGFloat, rightInset: CGFloat, additionalSideInsets: UIEdgeInsets, bottomInset: CGFloat, toolbar: Toolbar, transition: ContainedViewLayoutTransition) {

View File

@ -887,7 +887,7 @@ public class SearchBarNode: ASDisplayNode, UITextFieldDelegate {
self.cancelButton.setAttributedTitle(NSAttributedString(string: self.cancelText ?? strings.Common_Cancel, font: self.cancelText != nil ? Font.semibold(17.0) : Font.regular(17.0), textColor: theme.accent), for: [])
}
if self.theme != theme {
self.backgroundNode.color = theme.background
self.backgroundNode.updateColor(color: theme.background, transition: .immediate)
if self.fieldStyle != .modern || self.forceSeparator {
self.separatorNode.backgroundColor = theme.separator
}

View File

@ -573,7 +573,7 @@ final class ThemeAccentColorControllerNode: ASDisplayNode, UIScrollViewDelegate
strongSelf.pageControlBackgroundNode.backgroundColor = color
strongSelf.patternButtonNode.buttonColor = color
strongSelf.colorsButtonNode.buttonColor = color
strongSelf.playButtonBackgroundNode.color = color
strongSelf.playButtonBackgroundNode.updateColor(color: color, transition: .immediate)
}
})
}

View File

@ -508,7 +508,7 @@ final class WallpaperColorPanelNode: ASDisplayNode {
func updateTheme(_ theme: PresentationTheme) {
self.theme = theme
self.backgroundNode.color = self.theme.chat.inputPanel.panelBackgroundColor
self.backgroundNode.updateColor(color: self.theme.chat.inputPanel.panelBackgroundColor, transition: .immediate)
self.topSeparatorNode.backgroundColor = self.theme.chat.inputPanel.panelSeparatorColor
self.bottomSeparatorNode.backgroundColor = self.theme.chat.inputPanel.panelSeparatorColor
self.multiColorFieldNode.updateTheme(theme)

View File

@ -642,7 +642,7 @@ final class WallpaperGalleryItemNode: GalleryItemNode {
strongSelf.motionButtonNode.buttonColor = color
strongSelf.colorsButtonNode.buttonColor = color
strongSelf.playButtonBackgroundNode.color = color
strongSelf.playButtonBackgroundNode.updateColor(color: color, transition: .immediate)
}))
} else if self.arguments.patternEnabled != previousArguments.patternEnabled {
self.patternButtonNode.isSelected = self.arguments.patternEnabled

View File

@ -98,7 +98,7 @@ final class WallpaperGalleryToolbarNode: ASDisplayNode {
func updateThemeAndStrings(theme: PresentationTheme, strings: PresentationStrings) {
self.theme = theme
self.backgroundNode.color = theme.rootController.tabBar.backgroundColor
self.backgroundNode.updateColor(color: theme.rootController.tabBar.backgroundColor, transition: .immediate)
self.separatorNode.backgroundColor = theme.rootController.tabBar.separatorColor
self.topSeparatorNode.backgroundColor = theme.rootController.tabBar.separatorColor
self.cancelHighlightBackgroundNode.backgroundColor = theme.list.itemHighlightedBackgroundColor

View File

@ -132,7 +132,7 @@ final class WallpaperOptionButtonNode: HighlightTrackingButtonNode {
var buttonColor: UIColor = UIColor(rgb: 0x000000, alpha: 0.3) {
didSet {
self.backgroundNode.color = self.buttonColor
self.backgroundNode.updateColor(color: self.buttonColor, transition: .immediate)
}
}

View File

@ -386,7 +386,7 @@ final class WallpaperPatternPanelNode: ASDisplayNode {
func updateTheme(_ theme: PresentationTheme) {
self.theme = theme
self.backgroundNode.color = self.theme.chat.inputPanel.panelBackgroundColor
self.backgroundNode.updateColor(color: self.theme.chat.inputPanel.panelBackgroundColor, transition: .immediate)
self.topSeparatorNode.backgroundColor = self.theme.chat.inputPanel.panelSeparatorColor
self.sliderView?.backColor = self.theme.list.disclosureArrowColor

View File

@ -8,11 +8,21 @@ import Postbox
public func selectDateFillStaticColor(theme: PresentationTheme, wallpaper: TelegramWallpaper) -> UIColor {
if case .color(0xffffff) = wallpaper {
return theme.chat.serviceMessage.components.withDefaultWallpaper.dateFillStatic
} else if case .builtin = wallpaper {
return UIColor(rgb: 0x748391, alpha: 0.45)
} else {
return theme.chat.serviceMessage.components.withCustomWallpaper.dateFillStatic
}
}
public func dateFillNeedsBlur(theme: PresentationTheme, wallpaper: TelegramWallpaper) -> Bool {
if case .builtin = wallpaper {
return false
} else {
return true
}
}
public let defaultServiceBackgroundColor = UIColor(rgb: 0x000000, alpha: 0.2)
public let defaultPresentationTheme = makeDefaultDayPresentationTheme(serviceBackgroundColor: defaultServiceBackgroundColor, day: false, preview: false)
public let defaultDayAccentColor = UIColor(rgb: 0x007ee5)

View File

@ -1608,10 +1608,10 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
if themeUpdated {
if case let .color(color) = self.chatPresentationInterfaceState.chatWallpaper, UIColor(rgb: color).isEqual(self.chatPresentationInterfaceState.theme.chat.inputPanel.panelBackgroundColorNoWallpaper) {
self.inputPanelBackgroundNode.color = self.chatPresentationInterfaceState.theme.chat.inputPanel.panelBackgroundColorNoWallpaper
self.inputPanelBackgroundNode.updateColor(color: self.chatPresentationInterfaceState.theme.chat.inputPanel.panelBackgroundColorNoWallpaper, transition: .immediate)
self.usePlainInputSeparator = true
} else {
self.inputPanelBackgroundNode.color = self.chatPresentationInterfaceState.theme.chat.inputPanel.panelBackgroundColor
self.inputPanelBackgroundNode.updateColor(color: self.chatPresentationInterfaceState.theme.chat.inputPanel.panelBackgroundColor, transition: .immediate)
self.usePlainInputSeparator = false
self.plainInputSeparatorAlpha = nil
}

View File

@ -796,8 +796,7 @@ final class ChatEmptyNode: ASDisplayNode {
self.currentTheme = interfaceState.theme
self.currentStrings = interfaceState.strings
self.backgroundNode.color = selectDateFillStaticColor(theme: interfaceState.theme, wallpaper: interfaceState.chatWallpaper)
self.backgroundNode.updateColor(color: selectDateFillStaticColor(theme: interfaceState.theme, wallpaper: interfaceState.chatWallpaper), enableBlur: dateFillNeedsBlur(theme: interfaceState.theme, wallpaper: interfaceState.chatWallpaper), transition: .immediate)
}
var isScheduledMessages = false

View File

@ -86,7 +86,7 @@ class ChatHistoryNavigationButtonNode: ASControlNode {
if self.theme !== theme {
self.theme = theme
self.backgroundNode.color = theme.chat.inputPanel.panelBackgroundColor
self.backgroundNode.updateColor(color: theme.chat.inputPanel.panelBackgroundColor, transition: .immediate)
switch self.type {
case .down:
self.imageNode.image = PresentationResourcesChat.chatHistoryNavigationButtonImage(theme)

View File

@ -13,7 +13,7 @@ final class ChatLoadingNode: ASDisplayNode {
private let offset: CGPoint
init(theme: PresentationTheme, chatWallpaper: TelegramWallpaper, bubbleCorners: PresentationChatBubbleCorners) {
self.backgroundNode = NavigationBackgroundNode(color: selectDateFillStaticColor(theme: theme, wallpaper: chatWallpaper))
self.backgroundNode = NavigationBackgroundNode(color: selectDateFillStaticColor(theme: theme, wallpaper: chatWallpaper), enableBlur: dateFillNeedsBlur(theme: theme, wallpaper: chatWallpaper))
let serviceColor = serviceMessageColorComponents(theme: theme, wallpaper: chatWallpaper)
self.activityIndicator = ActivityIndicator(type: .custom(serviceColor.primaryText, 22.0, 2.0, false), speed: .regular)

View File

@ -163,7 +163,7 @@ private final class ChatMessageActionButtonNode: ASDisplayNode {
node.backgroundBlurNode.frame = CGRect(origin: CGPoint(), size: CGSize(width: max(0.0, width), height: 42.0))
node.backgroundBlurNode.update(size: node.backgroundBlurNode.bounds.size, transition: .immediate)
node.backgroundBlurNode.color = selectDateFillStaticColor(theme: theme.theme, wallpaper: theme.wallpaper)
node.backgroundBlurNode.updateColor(color: selectDateFillStaticColor(theme: theme.theme, wallpaper: theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: theme.theme, wallpaper: theme.wallpaper), transition: .immediate)
if iconImage != nil {
if node.iconNode == nil {

View File

@ -109,7 +109,7 @@ class ChatMessageShareButton: HighlightableButtonNode {
} else {
updatedIconImage = PresentationResourcesChat.chatFreeShareButtonIcon(presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper)
}
self.backgroundNode.color = selectDateFillStaticColor(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper)
self.backgroundNode.updateColor(color: selectDateFillStaticColor(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper), transition: .immediate)
self.iconNode.image = updatedIconImage
}
var size = CGSize(width: 30.0, height: 30.0)
@ -1065,9 +1065,9 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
if needsReplyBackground {
if let replyBackgroundNode = strongSelf.replyBackgroundNode {
replyBackgroundNode.color = selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper)
replyBackgroundNode.updateColor(color: selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper), transition: .immediate)
} else {
let replyBackgroundNode = NavigationBackgroundNode(color: selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper))
let replyBackgroundNode = NavigationBackgroundNode(color: selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper))
strongSelf.replyBackgroundNode = replyBackgroundNode
strongSelf.contextSourceNode.contentNode.addSubnode(replyBackgroundNode)
}
@ -1157,9 +1157,9 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
if needsForwardBackground {
if let forwardBackgroundNode = strongSelf.forwardBackgroundNode {
forwardBackgroundNode.color = selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper)
forwardBackgroundNode.updateColor(color: selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper), transition: .immediate)
} else {
let forwardBackgroundNode = NavigationBackgroundNode(color: selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper))
let forwardBackgroundNode = NavigationBackgroundNode(color: selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper))
strongSelf.forwardBackgroundNode = forwardBackgroundNode
strongSelf.addSubnode(forwardBackgroundNode)
}

View File

@ -228,7 +228,7 @@ class ChatMessageDateAndStatusNode: ASDisplayNode {
return { context, presentationData, edited, impressionCount, dateText, type, constrainedSize, reactions, replyCount, isPinned, hasAutoremove in
let dateColor: UIColor
var backgroundImage: UIImage?
var blurredBackgroundColor: UIColor?
var blurredBackgroundColor: (UIColor, Bool)?
var outgoingStatus: ChatMessageDateAndStatusOutgoingType?
var leftInset: CGFloat
@ -328,7 +328,7 @@ class ChatMessageDateAndStatusNode: ASDisplayNode {
let serviceColor = serviceMessageColorComponents(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper)
dateColor = serviceColor.primaryText
blurredBackgroundColor = selectDateFillStaticColor(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper)
blurredBackgroundColor = (selectDateFillStaticColor(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper), dateFillNeedsBlur(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper))
leftInset = 0.0
loadedCheckFullImage = PresentationResourcesChat.chatFreeFullCheck(presentationData.theme.theme, size: checkSize, isDefaultWallpaper: isDefaultWallpaper)
loadedCheckPartialImage = PresentationResourcesChat.chatFreePartialCheck(presentationData.theme.theme, size: checkSize, isDefaultWallpaper: isDefaultWallpaper)
@ -350,7 +350,7 @@ class ChatMessageDateAndStatusNode: ASDisplayNode {
dateColor = serviceColor.primaryText
outgoingStatus = status
//backgroundImage = graphics.dateAndStatusFreeBackground
blurredBackgroundColor = selectDateFillStaticColor(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper)
blurredBackgroundColor = (selectDateFillStaticColor(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper), dateFillNeedsBlur(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper))
leftInset = 0.0
loadedCheckFullImage = PresentationResourcesChat.chatFreeFullCheck(presentationData.theme.theme, size: checkSize, isDefaultWallpaper: isDefaultWallpaper)
loadedCheckPartialImage = PresentationResourcesChat.chatFreePartialCheck(presentationData.theme.theme, size: checkSize, isDefaultWallpaper: isDefaultWallpaper)
@ -611,7 +611,7 @@ class ChatMessageDateAndStatusNode: ASDisplayNode {
if let blurredBackgroundColor = blurredBackgroundColor {
if let blurredBackgroundNode = strongSelf.blurredBackgroundNode {
blurredBackgroundNode.color = blurredBackgroundColor
blurredBackgroundNode.updateColor(color: blurredBackgroundColor.0, enableBlur: blurredBackgroundColor.1, transition: .immediate)
let transition: ContainedViewLayoutTransition = animated ? .animated(duration: 0.4, curve: .spring) : .immediate
if let previousLayoutSize = previousLayoutSize {
blurredBackgroundNode.frame = blurredBackgroundNode.frame.offsetBy(dx: layoutSize.width - previousLayoutSize.width, dy: 0.0)
@ -619,7 +619,7 @@ class ChatMessageDateAndStatusNode: ASDisplayNode {
transition.updateFrame(node: blurredBackgroundNode, frame: CGRect(origin: CGPoint(), size: layoutSize))
blurredBackgroundNode.update(size: blurredBackgroundNode.bounds.size, cornerRadius: blurredBackgroundNode.bounds.height / 2.0, transition: transition)
} else {
let blurredBackgroundNode = NavigationBackgroundNode(color: blurredBackgroundColor)
let blurredBackgroundNode = NavigationBackgroundNode(color: blurredBackgroundColor.0, enableBlur: blurredBackgroundColor.1)
strongSelf.blurredBackgroundNode = blurredBackgroundNode
strongSelf.insertSubnode(blurredBackgroundNode, at: 0)
blurredBackgroundNode.frame = CGRect(origin: CGPoint(), size: layoutSize)

View File

@ -166,7 +166,7 @@ final class ChatMessageDateHeaderNode: ListViewItemHeaderNode {
let graphics = PresentationResourcesChat.principalGraphics(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper, bubbleCorners: presentationData.chatBubbleCorners)
//self.backgroundNode.image = graphics.dateStaticBackground
self.backgroundNode.color = selectDateFillStaticColor(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper)
self.backgroundNode.updateColor(color: selectDateFillStaticColor(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper), transition: .immediate)
self.stickBackgroundNode.image = graphics.dateFloatingBackground
self.stickBackgroundNode.alpha = 0.0
//self.backgroundNode.addSubnode(self.stickBackgroundNode)
@ -200,7 +200,7 @@ final class ChatMessageDateHeaderNode: ListViewItemHeaderNode {
let graphics = PresentationResourcesChat.principalGraphics(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper, bubbleCorners: presentationData.chatBubbleCorners)
//self.backgroundNode.image = graphics.dateStaticBackground
self.backgroundNode.color = selectDateFillStaticColor(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper)
self.backgroundNode.updateColor(color: selectDateFillStaticColor(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper), transition: .immediate)
self.stickBackgroundNode.image = graphics.dateFloatingBackground
let titleFont = Font.medium(min(18.0, floor(presentationData.fontSize.baseDisplaySize * 13.0 / 17.0)))
@ -218,8 +218,8 @@ final class ChatMessageDateHeaderNode: ListViewItemHeaderNode {
self.setNeedsLayout()
}
func updateBackgroundColor(_ color: UIColor) {
self.backgroundNode.color = color
func updateBackgroundColor(color: UIColor, enableBlur: Bool) {
self.backgroundNode.updateColor(color: color, enableBlur: enableBlur, transition: .immediate)
/*let chatDateSize: CGFloat = 20.0
self.backgroundNode.image = generateImage(CGSize(width: chatDateSize, height: chatDateSize), contextGenerator: { size, context -> Void in
context.clear(CGRect(origin: CGPoint(), size: size))

View File

@ -359,12 +359,12 @@ class ChatMessageInteractiveInstantVideoNode: ASDisplayNode {
if let telegramFile = updatedFile {
if updatedMedia {
let durationTextColor: UIColor
let durationBlurColor: UIColor?
let durationBlurColor: (UIColor, Bool)?
switch statusDisplayType {
case .free:
let serviceColor = serviceMessageColorComponents(theme: theme.theme, wallpaper: theme.wallpaper)
durationTextColor = serviceColor.primaryText
durationBlurColor = selectDateFillStaticColor(theme: theme.theme, wallpaper: theme.wallpaper)
durationBlurColor = (selectDateFillStaticColor(theme: theme.theme, wallpaper: theme.wallpaper), dateFillNeedsBlur(theme: theme.theme, wallpaper: theme.wallpaper))
case .bubble:
durationBlurColor = nil
if item.message.effectivelyIncoming(item.context.account.peerId) {
@ -376,9 +376,9 @@ class ChatMessageInteractiveInstantVideoNode: ASDisplayNode {
if let durationBlurColor = durationBlurColor {
if let durationBackgroundNode = strongSelf.durationBackgroundNode {
durationBackgroundNode.color = durationBlurColor
durationBackgroundNode.updateColor(color: durationBlurColor.0, enableBlur: durationBlurColor.1, transition: .immediate)
} else {
let durationBackgroundNode = NavigationBackgroundNode(color: durationBlurColor)
let durationBackgroundNode = NavigationBackgroundNode(color: durationBlurColor.0, enableBlur: durationBlurColor.1)
strongSelf.durationBackgroundNode = durationBackgroundNode
strongSelf.addSubnode(durationBackgroundNode)
}

View File

@ -705,9 +705,9 @@ class ChatMessageStickerItemNode: ChatMessageItemView {
if needsReplyBackground {
if let replyBackgroundNode = strongSelf.replyBackgroundNode {
replyBackgroundNode.color = selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper)
replyBackgroundNode.updateColor(color: selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper), transition: .immediate)
} else {
let replyBackgroundNode = NavigationBackgroundNode(color: selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper))
let replyBackgroundNode = NavigationBackgroundNode(color: selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper))
strongSelf.replyBackgroundNode = replyBackgroundNode
strongSelf.contextSourceNode.contentNode.addSubnode(replyBackgroundNode)
}

View File

@ -632,7 +632,7 @@ final class ChatRecentActionsControllerNode: ViewControllerTracingNode {
}
func updateThemeAndStrings(theme: PresentationTheme, strings: PresentationStrings) {
self.panelBackgroundNode.color = theme.chat.inputPanel.panelBackgroundColor
self.panelBackgroundNode.updateColor(color: theme.chat.inputPanel.panelBackgroundColor, transition: .immediate)
self.panelSeparatorNode.backgroundColor = theme.chat.inputPanel.panelSeparatorColor
self.panelButtonNode.setTitle(presentationData.strings.Channel_AdminLog_InfoPanelTitle, with: Font.regular(17.0), with: theme.chat.inputPanel.panelControlAccentColor, for: [])
}

View File

@ -1951,7 +1951,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
var transitionSourceTitleFrame = CGRect()
var transitionSourceSubtitleFrame = CGRect()
self.backgroundNode.color = presentationData.theme.rootController.navigationBar.blurredBackgroundColor
self.backgroundNode.updateColor(color: presentationData.theme.rootController.navigationBar.blurredBackgroundColor, transition: .immediate)
if let navigationTransition = self.navigationTransition, let sourceAvatarNode = (navigationTransition.sourceNavigationBar.rightButtonNode.singleCustomNode as? ChatAvatarNavigationNode)?.avatarNode {
transitionSourceHeight = navigationTransition.sourceNavigationBar.backgroundNode.bounds.height

View File

@ -692,7 +692,7 @@ final class PeerInfoPaneContainerNode: ASDisplayNode, UIGestureRecognizerDelegat
transition.updateAlpha(node: self.coveringBackgroundNode, alpha: expansionFraction)
self.backgroundColor = presentationData.theme.list.itemBlocksBackgroundColor
self.coveringBackgroundNode.color = presentationData.theme.rootController.navigationBar.opaqueBackgroundColor
self.coveringBackgroundNode.updateColor(color: presentationData.theme.rootController.navigationBar.opaqueBackgroundColor, transition: .immediate)
self.separatorNode.backgroundColor = presentationData.theme.list.itemBlocksSeparatorColor
self.tabsSeparatorNode.backgroundColor = presentationData.theme.list.itemBlocksSeparatorColor

View File

@ -176,7 +176,7 @@ final class PeerSelectionControllerNode: ASDisplayNode {
self.searchDisplayController?.updatePresentationData(self.presentationData)
self.chatListNode.updateThemeAndStrings(theme: self.presentationData.theme, fontSize: self.presentationData.listsFontSize, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: true)
self.toolbarBackgroundNode?.color = self.presentationData.theme.rootController.navigationBar.blurredBackgroundColor
self.toolbarBackgroundNode?.updateColor(color: self.presentationData.theme.rootController.navigationBar.blurredBackgroundColor, transition: .immediate)
self.toolbarSeparatorNode?.backgroundColor = self.presentationData.theme.rootController.navigationBar.separatorColor
self.segmentedControlNode?.updateTheme(SegmentedControlTheme(theme: self.presentationData.theme))
}