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

@@ -242,14 +242,8 @@ private final class ProxyServerInfoItemNode: ActionSheetItemNode {
self.setNeedsLayout()
}
override func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize {
return CGSize(width: constrainedSize.width, height: 36.0 * CGFloat(self.fieldNodes.count) + 12.0)
}
override func layout() {
super.layout()
let size = self.bounds.size
public override func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize {
let size = CGSize(width: constrainedSize.width, height: 36.0 * CGFloat(self.fieldNodes.count) + 12.0)
var offset: CGFloat = 15.0
for (lhs, rhs) in self.fieldNodes {
@@ -261,6 +255,9 @@ private final class ProxyServerInfoItemNode: ActionSheetItemNode {
offset += 36.0
}
self.updateInternalLayout(size)
return size
}
}
@@ -360,14 +357,8 @@ private final class ProxyServerActionItemNode: ActionSheetItemNode {
}
}
override func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize {
return CGSize(width: constrainedSize.width, height: 57.0)
}
override func layout() {
super.layout()
let size = self.bounds.size
public override func updateLayout(constrainedSize: CGSize, transition: ContainedViewLayoutTransition) -> CGSize {
let size = CGSize(width: constrainedSize.width, height: 57.0)
self.buttonNode.frame = CGRect(origin: CGPoint(), size: size)
@@ -376,8 +367,11 @@ private final class ProxyServerActionItemNode: ActionSheetItemNode {
let activitySize = self.activityIndicator.measure(CGSize(width: 100.0, height: 100.0))
self.titleNode.frame = titleFrame
self.activityIndicator.frame = CGRect(origin: CGPoint(x: 14.0, y: titleFrame.minY - 0.0), size: activitySize)
self.updateInternalLayout(size)
return size
}
@objc private func buttonPressed() {
let proxyServerSettings = self.server
let _ = (self.accountManager.transaction { transaction -> ProxySettings in