mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Temp
This commit is contained in:
@@ -312,6 +312,7 @@ open class BlurredBackgroundView: UIView {
|
||||
private var _color: UIColor?
|
||||
|
||||
private var enableBlur: Bool
|
||||
private var customBlurRadius: CGFloat?
|
||||
|
||||
public private(set) var effectView: UIVisualEffectView?
|
||||
private let backgroundView: UIView
|
||||
@@ -326,9 +327,10 @@ open class BlurredBackgroundView: UIView {
|
||||
}
|
||||
}
|
||||
|
||||
public init(color: UIColor?, enableBlur: Bool = true) {
|
||||
public init(color: UIColor?, enableBlur: Bool = true, customBlurRadius: CGFloat? = nil) {
|
||||
self._color = nil
|
||||
self.enableBlur = enableBlur
|
||||
self.customBlurRadius = customBlurRadius
|
||||
|
||||
self.backgroundView = UIView()
|
||||
|
||||
@@ -349,7 +351,6 @@ open class BlurredBackgroundView: UIView {
|
||||
if let color = self._color, self.enableBlur && !sharedIsReduceTransparencyEnabled && ((color.alpha > .ulpOfOne && color.alpha < 0.95) || forceKeepBlur) {
|
||||
if self.effectView == nil {
|
||||
let effectView = UIVisualEffectView(effect: UIBlurEffect(style: .light))
|
||||
//effectView.isHidden = true
|
||||
|
||||
for subview in effectView.subviews {
|
||||
if subview.description.contains("VisualEffectSubview") {
|
||||
@@ -373,6 +374,9 @@ open class BlurredBackgroundView: UIView {
|
||||
if !allowedKeys.contains(filterName) {
|
||||
return false
|
||||
}
|
||||
if let customBlurRadius = self.customBlurRadius, filterName == "gaussianBlur" {
|
||||
filter.setValue(customBlurRadius as NSNumber, forKey: "inputRadius")
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user