mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Merge e88baeeeb5 into 6e370e06d1
This commit is contained in:
commit
a02fd25c48
3 changed files with 20 additions and 1 deletions
|
|
@ -1129,6 +1129,8 @@ public protocol ChatController: ViewController {
|
|||
var isSendButtonVisible: Bool { get }
|
||||
|
||||
var isSelectingMessagesUpdated: ((Bool) -> Void)? { get set }
|
||||
var onGalleryPresentationInContextChanged: ((Bool) -> Void)? { get set }
|
||||
|
||||
func cancelSelectingMessages()
|
||||
func activateSearch(domain: ChatSearchDomain, query: String)
|
||||
func activateInput(type: ChatControllerActivateInput)
|
||||
|
|
|
|||
|
|
@ -192,6 +192,21 @@ final class HashtagSearchControllerNode: ASDisplayNode, ASGestureRecognizerDeleg
|
|||
}
|
||||
}
|
||||
|
||||
var galleryPresentationCount = 0
|
||||
let updateSearchBarVisibility: (Bool) -> Void = { [weak self] isPresented in
|
||||
guard let self else { return }
|
||||
if isPresented {
|
||||
galleryPresentationCount += 1
|
||||
} else {
|
||||
galleryPresentationCount -= 1
|
||||
}
|
||||
let shouldHide = galleryPresentationCount > 0
|
||||
self.controller?.navigationBar?.setContentNode(shouldHide ? nil : self.searchContentNode, animated: true)
|
||||
}
|
||||
self.currentController?.onGalleryPresentationInContextChanged = updateSearchBarVisibility
|
||||
self.myController?.onGalleryPresentationInContextChanged = updateSearchBarVisibility
|
||||
self.globalController?.onGalleryPresentationInContextChanged = updateSearchBarVisibility
|
||||
|
||||
if controller.mode != .chatOnly {
|
||||
navigationBar?.setContentNode(self.searchContentNode, animated: false)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -310,6 +310,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||
let temporaryHiddenGalleryMediaDisposable = MetaDisposable()
|
||||
|
||||
let galleryPresentationContext = PresentationContext()
|
||||
public var onGalleryPresentationInContextChanged: ((Bool) -> Void)?
|
||||
|
||||
let chatBackgroundNode: WallpaperBackgroundNode
|
||||
public private(set) var controllerInteraction: ChatControllerInteraction?
|
||||
|
|
@ -7376,11 +7377,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||
override public func loadDisplayNode() {
|
||||
self.loadDisplayNodeImpl()
|
||||
self.galleryPresentationContext.view = self.view
|
||||
self.galleryPresentationContext.controllersUpdated = { [weak self] _ in
|
||||
self.galleryPresentationContext.controllersUpdated = { [weak self] controllers in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
self.updateStatusBarPresentation()
|
||||
self.onGalleryPresentationInContextChanged?(!controllers.isEmpty)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue