UI combo update

This commit is contained in:
Ali
2021-05-07 18:10:31 +04:00
parent a82d1351bd
commit a5f4d23489
31 changed files with 719 additions and 289 deletions

View File

@@ -5,6 +5,7 @@ import AsyncDisplayKit
import TelegramPresentationData
final class ChatRequestInProgressTitlePanelNode: ChatTitleAccessoryPanelNode {
private let backgroundNode: NavigationBackgroundNode
private let separatorNode: ASDisplayNode
private let titleNode: ImmediateTextNode
@@ -12,6 +13,8 @@ final class ChatRequestInProgressTitlePanelNode: ChatTitleAccessoryPanelNode {
private var strings: PresentationStrings?
override init() {
self.backgroundNode = NavigationBackgroundNode(color: .clear)
self.separatorNode = ASDisplayNode()
self.separatorNode.isLayerBacked = true
@@ -19,7 +22,8 @@ final class ChatRequestInProgressTitlePanelNode: ChatTitleAccessoryPanelNode {
self.titleNode.maximumNumberOfLines = 1
super.init()
self.addSubnode(self.backgroundNode)
self.addSubnode(self.titleNode)
self.addSubnode(self.separatorNode)
}
@@ -34,11 +38,14 @@ final class ChatRequestInProgressTitlePanelNode: ChatTitleAccessoryPanelNode {
if interfaceState.theme !== self.theme {
self.theme = interfaceState.theme
self.backgroundColor = interfaceState.theme.chat.historyNavigation.fillColor
self.separatorNode.backgroundColor = interfaceState.theme.chat.historyNavigation.strokeColor
self.backgroundNode.color = interfaceState.theme.rootController.navigationBar.backgroundColor
self.separatorNode.backgroundColor = interfaceState.theme.rootController.navigationBar.separatorColor
}
let panelHeight: CGFloat = 40.0
transition.updateFrame(node: self.backgroundNode, frame: CGRect(origin: CGPoint(), size: CGSize(width: width, height: panelHeight)))
self.backgroundNode.update(size: self.backgroundNode.bounds.size, transition: transition)
let titleSize = self.titleNode.updateLayout(CGSize(width: width - leftInset - rightInset, height: 100.0))
transition.updateFrame(node: self.titleNode, frame: CGRect(origin: CGPoint(x: floor((width - titleSize.width) / 2.0), y: floor((panelHeight - titleSize.height) / 2.0)), size: titleSize))