Various fixes

This commit is contained in:
Ilya Laktyushin
2021-02-14 12:01:17 +04:00
parent f1d322a717
commit 3b155f9d52
32 changed files with 260 additions and 269 deletions

View File

@@ -87,7 +87,7 @@ private final class ChannelDiscussionGroupActionSheetItemNode: ActionSheetItemNo
self.textNode.attributedText = attributedText
}
override func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize {
public override func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize {
let textSize = self.textNode.updateLayout(CGSize(width: constrainedSize.width - 20.0, height: .greatestFiniteMagnitude))
let topInset: CGFloat = 16.0
@@ -105,10 +105,9 @@ private final class ChannelDiscussionGroupActionSheetItemNode: ActionSheetItemNo
self.textNode.frame = CGRect(origin: CGPoint(x: floor((constrainedSize.width - textSize.width) / 2.0), y: topInset + avatarSize + textSpacing), size: textSize)
return CGSize(width: constrainedSize.width, height: topInset + avatarSize + textSpacing + textSize.height + bottomInset)
}
override func layout() {
super.layout()
let size = CGSize(width: constrainedSize.width, height: topInset + avatarSize + textSpacing + textSize.height + bottomInset)
self.updateInternalLayout(size)
return size
}
}