mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Various improvements
This commit is contained in:
@@ -14,17 +14,20 @@ public final class PlainButtonComponent: Component {
|
||||
public let effectAlignment: EffectAlignment
|
||||
public let minSize: CGSize?
|
||||
public let action: () -> Void
|
||||
public let isEnabled: Bool
|
||||
|
||||
public init(
|
||||
content: AnyComponent<Empty>,
|
||||
effectAlignment: EffectAlignment,
|
||||
minSize: CGSize? = nil,
|
||||
action: @escaping () -> Void
|
||||
action: @escaping () -> Void,
|
||||
isEnabled: Bool = true
|
||||
) {
|
||||
self.content = content
|
||||
self.effectAlignment = effectAlignment
|
||||
self.minSize = minSize
|
||||
self.action = action
|
||||
self.isEnabled = isEnabled
|
||||
}
|
||||
|
||||
public static func ==(lhs: PlainButtonComponent, rhs: PlainButtonComponent) -> Bool {
|
||||
@@ -37,6 +40,9 @@ public final class PlainButtonComponent: Component {
|
||||
if lhs.minSize != rhs.minSize {
|
||||
return false
|
||||
}
|
||||
if lhs.isEnabled != rhs.isEnabled {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -121,7 +127,7 @@ public final class PlainButtonComponent: Component {
|
||||
self.component = component
|
||||
self.componentState = state
|
||||
|
||||
self.isEnabled = true
|
||||
self.isEnabled = component.isEnabled
|
||||
|
||||
let contentAlpha: CGFloat = 1.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user