diff --git a/submodules/TelegramUI/Components/GlassBackgroundComponent/Sources/GlassBackgroundComponent.swift b/submodules/TelegramUI/Components/GlassBackgroundComponent/Sources/GlassBackgroundComponent.swift index de07391ffc..5c66aac2a6 100644 --- a/submodules/TelegramUI/Components/GlassBackgroundComponent/Sources/GlassBackgroundComponent.swift +++ b/submodules/TelegramUI/Components/GlassBackgroundComponent/Sources/GlassBackgroundComponent.swift @@ -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, 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 diff --git a/submodules/TelegramUI/Components/VideoMessageCameraScreen/Sources/VideoMessageCameraScreen.swift b/submodules/TelegramUI/Components/VideoMessageCameraScreen/Sources/VideoMessageCameraScreen.swift index f6c371dee2..446347fd42 100644 --- a/submodules/TelegramUI/Components/VideoMessageCameraScreen/Sources/VideoMessageCameraScreen.swift +++ b/submodules/TelegramUI/Components/VideoMessageCameraScreen/Sources/VideoMessageCameraScreen.swift @@ -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)) ))