Fix build

This commit is contained in:
Isaac 2025-09-23 21:04:01 +08:00
parent 0ebc5dac3a
commit b62fd285d6
2 changed files with 11 additions and 2 deletions

View file

@ -771,11 +771,13 @@ public extension GlassBackgroundView {
public final class GlassBackgroundComponent: Component {
private let size: CGSize
private let cornerRadius: CGFloat
private let isDark: Bool
private let tintColor: GlassBackgroundView.TintColor
public init(size: CGSize, isDark: Bool, tintColor: GlassBackgroundView.TintColor) {
public init(size: CGSize, cornerRadius: CGFloat, isDark: Bool, tintColor: GlassBackgroundView.TintColor) {
self.size = size
self.cornerRadius = cornerRadius
self.isDark = isDark
self.tintColor = tintColor
}
@ -784,6 +786,9 @@ public final class GlassBackgroundComponent: Component {
if lhs.size != rhs.size {
return false
}
if lhs.cornerRadius != rhs.cornerRadius {
return false
}
if lhs.isDark != rhs.isDark {
return false
}
@ -795,7 +800,7 @@ public final class GlassBackgroundComponent: Component {
public final class View: GlassBackgroundView {
func update(component: GlassBackgroundComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment<Empty>, transition: ComponentTransition) -> CGSize {
self.update(size: component.size, cornerRadius: component.size.height / 2.0, isDark: component.isDark, tintColor: component.tintColor, transition: transition)
self.update(size: component.size, cornerRadius: component.cornerRadius, isDark: component.isDark, tintColor: component.tintColor, transition: transition)
self.frame = CGRect(origin: .zero, size: component.size)
return component.size

View file

@ -586,6 +586,7 @@ private final class VideoMessageCameraScreenComponent: CombinedComponent {
let flipButtonBackground = flipButtonBackground.update(
component: GlassBackgroundComponent(
size: CGSize(width: 40.0, height: 40.0),
cornerRadius: 40.0 * 0.5,
isDark: environment.theme.overallDarkAppearance,
tintColor: .init(kind: .panel, color: environment.theme.chat.inputPanel.inputBackgroundColor.withMultipliedAlpha(0.7))
),
@ -688,6 +689,7 @@ private final class VideoMessageCameraScreenComponent: CombinedComponent {
let flashButtonBackground = flashButtonBackground.update(
component: GlassBackgroundComponent(
size: CGSize(width: 40.0, height: 40.0),
cornerRadius: 40.0 * 0.5,
isDark: environment.theme.overallDarkAppearance,
tintColor: .init(kind: .panel, color: environment.theme.chat.inputPanel.inputBackgroundColor.withMultipliedAlpha(0.7))
),
@ -719,6 +721,7 @@ private final class VideoMessageCameraScreenComponent: CombinedComponent {
component: AnyComponent(
GlassBackgroundComponent(
size: CGSize(width: 40.0, height: 40.0),
cornerRadius: 40.0 * 0.5,
isDark: environment.theme.overallDarkAppearance,
tintColor: .init(kind: .panel, color: environment.theme.chat.inputPanel.inputBackgroundColor.withMultipliedAlpha(0.7))
)
@ -763,6 +766,7 @@ private final class VideoMessageCameraScreenComponent: CombinedComponent {
id: "background",
component: AnyComponent(GlassBackgroundComponent(
size: CGSize(width: 40.0, height: 40.0),
cornerRadius: 40.0 * 0.5,
isDark: environment.theme.overallDarkAppearance,
tintColor: .init(kind: .panel, color: environment.theme.chat.inputPanel.inputBackgroundColor.withMultipliedAlpha(0.7))
))