Various improvements

This commit is contained in:
Ilya Laktyushin
2023-11-25 14:10:36 +04:00
parent 3aaa0ad17b
commit 9cd6344b53
84 changed files with 3895 additions and 3057 deletions

View File

@@ -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