mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Moderation sheet improvements
This commit is contained in:
parent
b4e1173279
commit
2d65b3d90b
21 changed files with 1183 additions and 241 deletions
|
|
@ -69,6 +69,8 @@ open class IconSwitchNode: ASDisplayNode {
|
|||
}
|
||||
}
|
||||
|
||||
private var _isLocked: Bool = false
|
||||
|
||||
override public init() {
|
||||
super.init()
|
||||
|
||||
|
|
@ -82,8 +84,8 @@ open class IconSwitchNode: ASDisplayNode {
|
|||
|
||||
(self.view as! UISwitch).backgroundColor = self.backgroundColor
|
||||
(self.view as! UISwitch).tintColor = self.frameColor
|
||||
//(self.view as! UISwitch).thumbTintColor = self.handleColor
|
||||
(self.view as! UISwitch).onTintColor = self.contentColor
|
||||
(self.view as? TGIconSwitchView)?.updateIsLocked(self._isLocked)
|
||||
(self.view as! IconSwitchNodeView).setNegativeContentColor(self.negativeContentColor)
|
||||
(self.view as! IconSwitchNodeView).setPositiveContentColor(self.positiveContentColor)
|
||||
|
||||
|
|
@ -99,6 +101,16 @@ open class IconSwitchNode: ASDisplayNode {
|
|||
}
|
||||
}
|
||||
|
||||
public func updateIsLocked(_ value: Bool) {
|
||||
if self._isLocked == value {
|
||||
return
|
||||
}
|
||||
self._isLocked = value
|
||||
if self.isNodeLoaded {
|
||||
(self.view as? TGIconSwitchView)?.updateIsLocked(value)
|
||||
}
|
||||
}
|
||||
|
||||
override open func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize {
|
||||
return CGSize(width: 51.0, height: 31.0)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue