mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Various improvements
This commit is contained in:
@@ -17,7 +17,9 @@ public final class SolidRoundedButtonComponent: Component {
|
||||
public let cornerRadius: CGFloat
|
||||
public let gloss: Bool
|
||||
public let iconName: String?
|
||||
public let animationName: String?
|
||||
public let iconPosition: SolidRoundedButtonIconPosition
|
||||
public let iconSpacing: CGFloat
|
||||
public let isLoading: Bool
|
||||
public let action: () -> Void
|
||||
|
||||
@@ -31,7 +33,9 @@ public final class SolidRoundedButtonComponent: Component {
|
||||
cornerRadius: CGFloat = 24.0,
|
||||
gloss: Bool = false,
|
||||
iconName: String? = nil,
|
||||
animationName: String? = nil,
|
||||
iconPosition: SolidRoundedButtonIconPosition = .left,
|
||||
iconSpacing: CGFloat = 8.0,
|
||||
isLoading: Bool = false,
|
||||
action: @escaping () -> Void
|
||||
) {
|
||||
@@ -44,7 +48,9 @@ public final class SolidRoundedButtonComponent: Component {
|
||||
self.cornerRadius = cornerRadius
|
||||
self.gloss = gloss
|
||||
self.iconName = iconName
|
||||
self.animationName = animationName
|
||||
self.iconPosition = iconPosition
|
||||
self.iconSpacing = iconSpacing
|
||||
self.isLoading = isLoading
|
||||
self.action = action
|
||||
}
|
||||
@@ -77,9 +83,15 @@ public final class SolidRoundedButtonComponent: Component {
|
||||
if lhs.iconName != rhs.iconName {
|
||||
return false
|
||||
}
|
||||
if lhs.animationName != rhs.animationName {
|
||||
return false
|
||||
}
|
||||
if lhs.iconPosition != rhs.iconPosition {
|
||||
return false
|
||||
}
|
||||
if lhs.iconSpacing != rhs.iconSpacing {
|
||||
return false
|
||||
}
|
||||
if lhs.isLoading != rhs.isLoading {
|
||||
return false
|
||||
}
|
||||
@@ -116,7 +128,9 @@ public final class SolidRoundedButtonComponent: Component {
|
||||
if let button = self.button {
|
||||
button.title = component.title
|
||||
button.iconPosition = component.iconPosition
|
||||
button.iconSpacing = component.iconSpacing
|
||||
button.icon = component.iconName.flatMap { UIImage(bundleImageName: $0) }
|
||||
button.animation = component.animationName
|
||||
button.gloss = component.gloss
|
||||
|
||||
button.updateTheme(component.theme)
|
||||
|
||||
Reference in New Issue
Block a user