mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Fix build
This commit is contained in:
@@ -438,6 +438,10 @@ open class BlurredBackgroundView: UIView {
|
||||
}
|
||||
}
|
||||
|
||||
public protocol NavigationBarHeaderView: UIView {
|
||||
func update(size: CGSize, transition: ContainedViewLayoutTransition)
|
||||
}
|
||||
|
||||
open class NavigationBar: ASDisplayNode {
|
||||
public static var defaultSecondaryContentHeight: CGFloat {
|
||||
return 38.0
|
||||
@@ -647,6 +651,18 @@ open class NavigationBar: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
public var customHeaderContentView: NavigationBarHeaderView? {
|
||||
didSet {
|
||||
if self.customHeaderContentView !== oldValue {
|
||||
self.customHeaderContentView?.removeFromSuperview()
|
||||
|
||||
if let customHeaderContentView = self.customHeaderContentView {
|
||||
self.view.addSubview(customHeaderContentView)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public var layoutSuspended: Bool = false
|
||||
|
||||
private let titleNode: ImmediateTextNode
|
||||
@@ -1355,6 +1371,12 @@ open class NavigationBar: ASDisplayNode {
|
||||
leftTitleInset -= 1.0
|
||||
}
|
||||
|
||||
if let customHeaderContentView = self.customHeaderContentView {
|
||||
let headerSize = CGSize(width: size.width, height: nominalHeight)
|
||||
customHeaderContentView.update(size: headerSize, transition: transition)
|
||||
transition.updateFrame(view: customHeaderContentView, frame: CGRect(origin: CGPoint(x: 0.0, y: contentVerticalOrigin), size: headerSize))
|
||||
}
|
||||
|
||||
if self.titleNode.supernode != nil {
|
||||
let titleSize = self.titleNode.updateLayout(CGSize(width: max(1.0, size.width - max(leftTitleInset, rightTitleInset) * 2.0), height: nominalHeight))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user