Fix more translucency

This commit is contained in:
Ali
2021-05-07 21:21:11 +04:00
parent 36dbee4f13
commit d3434bc02c
3 changed files with 15 additions and 11 deletions

View File

@@ -35,6 +35,7 @@ final class WallpaperGalleryToolbarNode: ASDisplayNode {
private let cancelHighlightBackgroundNode = ASDisplayNode()
private let doneButton = HighlightTrackingButtonNode()
private let doneHighlightBackgroundNode = ASDisplayNode()
private let backgroundNode = NavigationBackgroundNode(color: .clear)
private let separatorNode = ASDisplayNode()
private let topSeparatorNode = ASDisplayNode()
@@ -52,6 +53,7 @@ final class WallpaperGalleryToolbarNode: ASDisplayNode {
super.init()
self.addSubnode(self.backgroundNode)
self.addSubnode(self.cancelHighlightBackgroundNode)
self.addSubnode(self.cancelButton)
self.addSubnode(self.doneHighlightBackgroundNode)
@@ -96,7 +98,7 @@ final class WallpaperGalleryToolbarNode: ASDisplayNode {
func updateThemeAndStrings(theme: PresentationTheme, strings: PresentationStrings) {
self.theme = theme
self.backgroundColor = theme.rootController.tabBar.backgroundColor
self.backgroundNode.color = theme.rootController.tabBar.backgroundColor
self.separatorNode.backgroundColor = theme.rootController.tabBar.separatorColor
self.topSeparatorNode.backgroundColor = theme.rootController.tabBar.separatorColor
self.cancelHighlightBackgroundNode.backgroundColor = theme.list.itemHighlightedBackgroundColor
@@ -132,6 +134,8 @@ final class WallpaperGalleryToolbarNode: ASDisplayNode {
self.doneHighlightBackgroundNode.frame = CGRect(origin: CGPoint(x: floor(size.width / 2.0), y: 0.0), size: CGSize(width: size.width - floor(size.width / 2.0), height: size.height))
self.separatorNode.frame = CGRect(origin: CGPoint(x: floor(size.width / 2.0), y: 0.0), size: CGSize(width: UIScreenPixel, height: size.height + layout.intrinsicInsets.bottom))
self.topSeparatorNode.frame = CGRect(origin: CGPoint(), size: CGSize(width: size.width, height: UIScreenPixel))
self.backgroundNode.frame = CGRect(origin: CGPoint(), size: size)
self.backgroundNode.update(size: CGSize(width: size.width, height: size.height + layout.intrinsicInsets.bottom), transition: .immediate)
}
@objc func cancelPressed() {

View File

@@ -29,7 +29,7 @@ final class LocationBroadcastNavigationAccessoryPanel: ASDisplayNode {
private let tapAction: () -> Void
private let close: () -> Void
private let contentNode: ASDisplayNode
private let contentNode: NavigationBackgroundNode
private let iconNode: ASImageNode
private let wavesNode: LiveLocationWavesNode
@@ -50,8 +50,7 @@ final class LocationBroadcastNavigationAccessoryPanel: ASDisplayNode {
self.tapAction = tapAction
self.close = close
self.contentNode = ASDisplayNode()
self.contentNode.backgroundColor = self.theme.rootController.navigationBar.backgroundColor
self.contentNode = NavigationBackgroundNode(color: self.theme.rootController.navigationBar.backgroundColor)
self.iconNode = ASImageNode()
self.iconNode.isLayerBacked = true
@@ -101,7 +100,7 @@ final class LocationBroadcastNavigationAccessoryPanel: ASDisplayNode {
self.theme = presentationData.theme
self.strings = presentationData.strings
self.contentNode.backgroundColor = self.theme.rootController.navigationBar.backgroundColor
self.contentNode.color = self.theme.rootController.navigationBar.backgroundColor
self.iconNode.image = PresentationResourcesRootController.navigationLiveLocationIcon(self.theme)
self.wavesNode.color = self.theme.rootController.navigationBar.accentTextColor
@@ -113,6 +112,7 @@ final class LocationBroadcastNavigationAccessoryPanel: ASDisplayNode {
self.validLayout = (size, leftInset, rightInset)
transition.updateFrame(node: self.contentNode, frame: CGRect(origin: CGPoint(), size: size))
self.contentNode.update(size: self.contentNode.bounds.size, transition: transition)
let titleString = NSAttributedString(string: self.strings.Conversation_LiveLocation, font: titleFont, textColor: self.theme.rootController.navigationBar.primaryTextColor)
var subtitleString: NSAttributedString?

View File

@@ -8,7 +8,7 @@ import TelegramPresentationData
import AccountContext
public final class MediaNavigationAccessoryContainerNode: ASDisplayNode, UIGestureRecognizerDelegate {
public let backgroundNode: ASDisplayNode
public let backgroundNode: NavigationBackgroundNode
public let headerNode: MediaNavigationAccessoryHeaderNode
private let currentHeaderHeight: CGFloat = MediaNavigationAccessoryHeaderNode.minimizedHeight
@@ -18,12 +18,11 @@ public final class MediaNavigationAccessoryContainerNode: ASDisplayNode, UIGestu
init(context: AccountContext) {
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
self.backgroundNode = ASDisplayNode()
self.backgroundNode = NavigationBackgroundNode(color: self.presentationData.theme.rootController.navigationBar.backgroundColor)
self.headerNode = MediaNavigationAccessoryHeaderNode(presentationData: self.presentationData)
super.init()
self.backgroundNode.backgroundColor = self.presentationData.theme.rootController.navigationBar.backgroundColor
self.addSubnode(self.backgroundNode)
self.addSubnode(self.headerNode)
@@ -32,12 +31,13 @@ public final class MediaNavigationAccessoryContainerNode: ASDisplayNode, UIGestu
func updatePresentationData(_ presentationData: PresentationData) {
self.presentationData = presentationData
self.backgroundNode.backgroundColor = self.presentationData.theme.rootController.navigationBar.backgroundColor
self.backgroundNode.color = self.presentationData.theme.rootController.navigationBar.backgroundColor
self.headerNode.updatePresentationData(presentationData)
}
func updateLayout(size: CGSize, leftInset: CGFloat, rightInset: CGFloat, transition: ContainedViewLayoutTransition) {
transition.updateFrame(node: self.backgroundNode, frame: CGRect(origin: CGPoint(), size: CGSize(width: size.width, height: self.currentHeaderHeight)))
self.backgroundNode.update(size: self.backgroundNode.bounds.size, transition: transition)
let headerHeight = self.currentHeaderHeight
transition.updateFrame(node: self.headerNode, frame: CGRect(origin: CGPoint(), size: CGSize(width: size.width, height: headerHeight)))