Various improvements

This commit is contained in:
Ilya Laktyushin
2023-03-28 20:30:04 +04:00
parent 9abee7dc1f
commit 4ac9d1cb57
54 changed files with 2403 additions and 848 deletions

View File

@@ -221,7 +221,7 @@ final class WallpaperPatternPanelNode: ASDisplayNode {
}
}
private var validLayout: CGSize?
private var validLayout: (CGSize, CGFloat)?
var patternChanged: ((TelegramWallpaper?, Int32?, Bool) -> Void)?
@@ -401,8 +401,8 @@ final class WallpaperPatternPanelNode: ASDisplayNode {
self.titleNode.attributedText = NSAttributedString(string: self.labelNode.attributedText?.string ?? "", font: Font.bold(17.0), textColor: self.theme.rootController.navigationBar.primaryTextColor)
self.labelNode.attributedText = NSAttributedString(string: self.labelNode.attributedText?.string ?? "", font: Font.regular(14.0), textColor: self.theme.rootController.navigationBar.primaryTextColor)
if let size = self.validLayout {
self.updateLayout(size: size, transition: .immediate)
if let (size, bottomInset) = self.validLayout {
self.updateLayout(size: size, bottomInset: bottomInset, transition: .immediate)
}
}
@@ -478,11 +478,12 @@ final class WallpaperPatternPanelNode: ASDisplayNode {
}
}
func updateLayout(size: CGSize, transition: ContainedViewLayoutTransition) {
self.validLayout = size
func updateLayout(size: CGSize, bottomInset: CGFloat, transition: ContainedViewLayoutTransition) {
self.validLayout = (size, bottomInset)
transition.updateFrame(node: self.backgroundNode, frame: CGRect(x: 0.0, y: 0.0, width: size.width, height: size.height))
self.backgroundNode.update(size: self.backgroundNode.bounds.size, transition: transition)
let backgroundFrame = CGRect(x: 0.0, y: 0.0, width: size.width, height: size.height + bottomInset)
transition.updateFrame(node: self.backgroundNode, frame: backgroundFrame)
self.backgroundNode.update(size: backgroundFrame.size, transition: transition)
transition.updateFrame(node: self.topSeparatorNode, frame: CGRect(x: 0.0, y: 0.0, width: size.width, height: UIScreenPixel))
let titleSize = self.titleNode.updateLayout(self.bounds.size)