mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Wallpaper fixes
This commit is contained in:
@@ -88,34 +88,9 @@ public class NavigationBarSearchContentNode: NavigationBarContentNode {
|
||||
}
|
||||
|
||||
public func setIsEnabled(_ enabled: Bool, animated: Bool = false) {
|
||||
if !enabled {
|
||||
if self.disabledOverlay == nil {
|
||||
let disabledOverlay = ASDisplayNode()
|
||||
self.addSubnode(disabledOverlay)
|
||||
self.disabledOverlay = disabledOverlay
|
||||
if animated {
|
||||
disabledOverlay.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.25)
|
||||
}
|
||||
}
|
||||
if let disabledOverlay = self.disabledOverlay {
|
||||
disabledOverlay.backgroundColor = self.theme?.rootController.navigationBar.opaqueBackgroundColor.withAlphaComponent(0.4)
|
||||
|
||||
var disabledOverlayFrame = self.placeholderNode.frame
|
||||
if let searchBarHeight = self.placeholderHeight {
|
||||
disabledOverlayFrame.size.height = searchBarHeight
|
||||
}
|
||||
disabledOverlay.frame = disabledOverlayFrame
|
||||
}
|
||||
} else if let disabledOverlay = self.disabledOverlay {
|
||||
self.disabledOverlay = nil
|
||||
if animated {
|
||||
disabledOverlay.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.3, removeOnCompletion: false, completion: { [weak disabledOverlay] _ in
|
||||
disabledOverlay?.removeFromSupernode()
|
||||
})
|
||||
} else {
|
||||
disabledOverlay.removeFromSupernode()
|
||||
}
|
||||
}
|
||||
let transition: ContainedViewLayoutTransition = animated ? .animated(duration: 0.25, curve: .easeInOut) : .immediate
|
||||
transition.updateAlpha(node: self.placeholderNode, alpha: enabled ? 1.0 : 0.6)
|
||||
self.placeholderNode.isUserInteractionEnabled = enabled
|
||||
}
|
||||
|
||||
private func updatePlaceholder(_ progress: CGFloat, size: CGSize, leftInset: CGFloat, rightInset: CGFloat, transition: ContainedViewLayoutTransition) {
|
||||
|
||||
Reference in New Issue
Block a user