mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Switch to new check node implementation
This commit is contained in:
@@ -8,7 +8,7 @@ public final class ItemListSelectableControlNode: ASDisplayNode {
|
||||
private let checkNode: CheckNode
|
||||
|
||||
public init(strokeColor: UIColor, fillColor: UIColor, foregroundColor: UIColor) {
|
||||
self.checkNode = CheckNode(strokeColor: strokeColor, fillColor: fillColor, foregroundColor: foregroundColor, style: .plain)
|
||||
self.checkNode = CheckNode(theme: CheckNodeTheme(backgroundColor: fillColor, strokeColor: foregroundColor, borderColor: strokeColor, overlayBorder: false, hasInset: true, hasShadow: false))
|
||||
self.checkNode.isUserInteractionEnabled = false
|
||||
|
||||
super.init()
|
||||
@@ -26,9 +26,9 @@ public final class ItemListSelectableControlNode: ASDisplayNode {
|
||||
}
|
||||
|
||||
return (compact ? 38.0 : 45.0, { size, animated in
|
||||
let checkSize = CGSize(width: 32.0, height: 32.0)
|
||||
resultNode.checkNode.frame = CGRect(origin: CGPoint(x: compact ? 9 : 12.0, y: floor((size.height - checkSize.height) / 2.0)), size: checkSize)
|
||||
resultNode.checkNode.setIsChecked(selected, animated: animated)
|
||||
let checkSize = CGSize(width: 26.0, height: 26.0)
|
||||
resultNode.checkNode.frame = CGRect(origin: CGPoint(x: compact ? 11.0 : 13.0, y: floorToScreenPixels((size.height - checkSize.height) / 2.0)), size: checkSize)
|
||||
resultNode.checkNode.setSelected(selected, animated: animated)
|
||||
return resultNode
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user