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

@@ -103,15 +103,9 @@ public class ActionSheetSwitchNode: ActionSheetItemNode {
self.setNeedsLayout()
}
public override func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize {
return CGSize(width: constrainedSize.width, height: 57.0)
}
public 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.button.frame = CGRect(origin: CGPoint(), size: size)
let labelSize = self.label.updateLayout(CGSize(width: max(1.0, size.width - 51.0 - 16.0 * 2.0), height: size.height))
@@ -121,6 +115,9 @@ public class ActionSheetSwitchNode: ActionSheetItemNode {
self.switchNode.frame = CGRect(origin: CGPoint(x: size.width - 16.0 - switchSize.width, y: floor((size.height - switchSize.height) / 2.0)), size: switchSize)
self.accessibilityArea.frame = CGRect(origin: CGPoint(), size: size)
self.updateInternalLayout(size)
return size
}
@objc func buttonPressed() {