mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Various fixes
This commit is contained in:
@@ -7,6 +7,7 @@ public final class CameraButton: Component {
|
||||
let minSize: CGSize?
|
||||
let tag: AnyObject?
|
||||
let isEnabled: Bool
|
||||
let isExclusive: Bool
|
||||
let action: () -> Void
|
||||
let longTapAction: (() -> Void)?
|
||||
|
||||
@@ -15,6 +16,7 @@ public final class CameraButton: Component {
|
||||
minSize: CGSize? = nil,
|
||||
tag: AnyObject? = nil,
|
||||
isEnabled: Bool = true,
|
||||
isExclusive: Bool = true,
|
||||
action: @escaping () -> Void,
|
||||
longTapAction: (() -> Void)? = nil
|
||||
) {
|
||||
@@ -22,6 +24,7 @@ public final class CameraButton: Component {
|
||||
self.minSize = minSize
|
||||
self.tag = tag
|
||||
self.isEnabled = isEnabled
|
||||
self.isExclusive = isExclusive
|
||||
self.action = action
|
||||
self.longTapAction = longTapAction
|
||||
}
|
||||
@@ -32,6 +35,7 @@ public final class CameraButton: Component {
|
||||
minSize: self.minSize,
|
||||
tag: tag,
|
||||
isEnabled: self.isEnabled,
|
||||
isExclusive: self.isExclusive,
|
||||
action: self.action,
|
||||
longTapAction: self.longTapAction
|
||||
)
|
||||
@@ -50,6 +54,9 @@ public final class CameraButton: Component {
|
||||
if lhs.isEnabled != rhs.isEnabled {
|
||||
return false
|
||||
}
|
||||
if lhs.isExclusive != rhs.isExclusive {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -90,8 +97,6 @@ public final class CameraButton: Component {
|
||||
|
||||
super.init(frame: frame)
|
||||
|
||||
self.isExclusiveTouch = true
|
||||
|
||||
self.addSubview(self.containerView)
|
||||
self.containerView.addSubview(self.contentView)
|
||||
|
||||
@@ -175,6 +180,8 @@ public final class CameraButton: Component {
|
||||
|
||||
self.component = component
|
||||
|
||||
self.isExclusiveTouch = component.isExclusive
|
||||
|
||||
self.updateScale(transition: transition)
|
||||
self.isEnabled = component.isEnabled
|
||||
self.longTapGestureRecognizer?.isEnabled = component.longTapAction != nil
|
||||
|
||||
Reference in New Issue
Block a user