mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Stories
This commit is contained in:
@@ -12,15 +12,18 @@ public final class PlainButtonComponent: Component {
|
||||
|
||||
public let content: AnyComponent<Empty>
|
||||
public let effectAlignment: EffectAlignment
|
||||
public let minSize: CGSize?
|
||||
public let action: () -> Void
|
||||
|
||||
public init(
|
||||
content: AnyComponent<Empty>,
|
||||
effectAlignment: EffectAlignment,
|
||||
minSize: CGSize? = nil,
|
||||
action: @escaping () -> Void
|
||||
) {
|
||||
self.content = content
|
||||
self.effectAlignment = effectAlignment
|
||||
self.minSize = minSize
|
||||
self.action = action
|
||||
}
|
||||
|
||||
@@ -31,6 +34,9 @@ public final class PlainButtonComponent: Component {
|
||||
if lhs.effectAlignment != rhs.effectAlignment {
|
||||
return false
|
||||
}
|
||||
if lhs.minSize != rhs.minSize {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -122,7 +128,11 @@ public final class PlainButtonComponent: Component {
|
||||
containerSize: availableSize
|
||||
)
|
||||
|
||||
let size = contentSize
|
||||
var size = contentSize
|
||||
if let minSize = component.minSize {
|
||||
size.width = max(size.width, minSize.width)
|
||||
size.height = max(size.height, minSize.height)
|
||||
}
|
||||
|
||||
if let contentView = self.content.view {
|
||||
var contentTransition = transition
|
||||
|
||||
Reference in New Issue
Block a user