mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 21:41:45 +00:00
Fix title panels
This commit is contained in:
parent
3da099ff70
commit
9ee9845439
@ -526,7 +526,7 @@ func updateChatPresentationInterfaceStateImpl(
|
|||||||
selfController.updateDownButtonVisibility()
|
selfController.updateDownButtonVisibility()
|
||||||
|
|
||||||
if case .standard(.embedded) = selfController.presentationInterfaceState.mode, let controllerInteraction = selfController.controllerInteraction, let interfaceInteraction = selfController.interfaceInteraction {
|
if case .standard(.embedded) = selfController.presentationInterfaceState.mode, let controllerInteraction = selfController.controllerInteraction, let interfaceInteraction = selfController.interfaceInteraction {
|
||||||
if let titleAccessoryPanelNode = titlePanelForChatPresentationInterfaceState(selfController.presentationInterfaceState, context: selfController.context, currentPanel: selfController.customNavigationPanelNode as? ChatTitleAccessoryPanelNode, controllerInteraction: controllerInteraction, interfaceInteraction: interfaceInteraction) {
|
if let titleAccessoryPanelNode = titlePanelForChatPresentationInterfaceState(selfController.presentationInterfaceState, context: selfController.context, currentPanel: selfController.customNavigationPanelNode as? ChatTitleAccessoryPanelNode, controllerInteraction: controllerInteraction, interfaceInteraction: interfaceInteraction, force: true) {
|
||||||
selfController.customNavigationPanelNode = titleAccessoryPanelNode as? ChatControllerCustomNavigationPanelNode
|
selfController.customNavigationPanelNode = titleAccessoryPanelNode as? ChatControllerCustomNavigationPanelNode
|
||||||
} else {
|
} else {
|
||||||
selfController.customNavigationPanelNode = nil
|
selfController.customNavigationPanelNode = nil
|
||||||
|
|||||||
@ -1253,7 +1253,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
|||||||
var titleAccessoryPanelBackgroundHeight: CGFloat?
|
var titleAccessoryPanelBackgroundHeight: CGFloat?
|
||||||
var titleAccessoryPanelHitTestSlop: CGFloat?
|
var titleAccessoryPanelHitTestSlop: CGFloat?
|
||||||
var extraTransition = transition
|
var extraTransition = transition
|
||||||
if let titleAccessoryPanelNode = titlePanelForChatPresentationInterfaceState(self.chatPresentationInterfaceState, context: self.context, currentPanel: self.titleAccessoryPanelNode, controllerInteraction: self.controllerInteraction, interfaceInteraction: self.interfaceInteraction) {
|
if let titleAccessoryPanelNode = titlePanelForChatPresentationInterfaceState(self.chatPresentationInterfaceState, context: self.context, currentPanel: self.titleAccessoryPanelNode, controllerInteraction: self.controllerInteraction, interfaceInteraction: self.interfaceInteraction, force: false) {
|
||||||
if self.titleAccessoryPanelNode != titleAccessoryPanelNode {
|
if self.titleAccessoryPanelNode != titleAccessoryPanelNode {
|
||||||
dismissedTitleAccessoryPanelNode = self.titleAccessoryPanelNode
|
dismissedTitleAccessoryPanelNode = self.titleAccessoryPanelNode
|
||||||
self.titleAccessoryPanelNode = titleAccessoryPanelNode
|
self.titleAccessoryPanelNode = titleAccessoryPanelNode
|
||||||
|
|||||||
@ -5,7 +5,11 @@ import AccountContext
|
|||||||
import ChatPresentationInterfaceState
|
import ChatPresentationInterfaceState
|
||||||
import ChatControllerInteraction
|
import ChatControllerInteraction
|
||||||
|
|
||||||
func titlePanelForChatPresentationInterfaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, currentPanel: ChatTitleAccessoryPanelNode?, controllerInteraction: ChatControllerInteraction?, interfaceInteraction: ChatPanelInterfaceInteraction?) -> ChatTitleAccessoryPanelNode? {
|
func titlePanelForChatPresentationInterfaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, currentPanel: ChatTitleAccessoryPanelNode?, controllerInteraction: ChatControllerInteraction?, interfaceInteraction: ChatPanelInterfaceInteraction?, force: Bool) -> ChatTitleAccessoryPanelNode? {
|
||||||
|
if !force, case .standard(.embedded) = chatPresentationInterfaceState.mode {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
if case .overlay = chatPresentationInterfaceState.mode {
|
if case .overlay = chatPresentationInterfaceState.mode {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user