mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
5e79ec4b32
commit
66d1aedcb0
@ -1158,7 +1158,7 @@ open class InteractiveTextNode: ASDisplayNode, TextNodeProtocol, UIGestureRecogn
|
||||
public func textRangeRects(in range: NSRange) -> (rects: [CGRect], start: TextRangeRectEdge, end: TextRangeRectEdge)? {
|
||||
return self.cachedLayout?.rangeRects(in: range)
|
||||
}
|
||||
|
||||
|
||||
override public init() {
|
||||
super.init()
|
||||
|
||||
@ -1946,7 +1946,7 @@ open class InteractiveTextNode: ASDisplayNode, TextNodeProtocol, UIGestureRecogn
|
||||
}
|
||||
} else {
|
||||
contentItemAnimation = .None
|
||||
contentItemLayer = TextContentItemLayer()
|
||||
contentItemLayer = TextContentItemLayer(displaysAsynchronously: self.displaysAsynchronously)
|
||||
self.contentItemLayers[contentItem.id] = contentItemLayer
|
||||
self.layer.addSublayer(contentItemLayer)
|
||||
}
|
||||
@ -2461,8 +2461,9 @@ final class TextContentItemLayer: SimpleLayer {
|
||||
private var isAnimating: Bool = false
|
||||
private var currentContentMask: RenderMask?
|
||||
|
||||
override init() {
|
||||
init(displaysAsynchronously: Bool) {
|
||||
self.renderNode = RenderNode()
|
||||
self.renderNode.displaysAsynchronously = displaysAsynchronously
|
||||
|
||||
super.init()
|
||||
|
||||
|
@ -112,11 +112,14 @@ public final class DrawingMessageRenderer {
|
||||
self.wallpaperColor = wallpaperColor
|
||||
|
||||
self.messagesContainerNode = ASDisplayNode()
|
||||
self.messagesContainerNode.displaysAsynchronously = false
|
||||
self.messagesContainerNode.clipsToBounds = true
|
||||
self.messagesContainerNode.transform = CATransform3DMakeScale(1.0, -1.0, 1.0)
|
||||
|
||||
super.init()
|
||||
|
||||
self.displaysAsynchronously = false
|
||||
|
||||
self.addSubnode(self.messagesContainerNode)
|
||||
}
|
||||
|
||||
|
@ -173,6 +173,24 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte
|
||||
var accessoryItems: [ChatTextInputAccessoryItem] = []
|
||||
let isTextEmpty = chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0
|
||||
let hasForward = chatPresentationInterfaceState.interfaceState.forwardMessageIds != nil
|
||||
|
||||
var extendedSearchLayout = false
|
||||
loop: for (_, result) in chatPresentationInterfaceState.inputQueryResults {
|
||||
if case let .contextRequestResult(peer, _) = result, peer != nil {
|
||||
extendedSearchLayout = true
|
||||
break loop
|
||||
}
|
||||
}
|
||||
if !extendedSearchLayout {
|
||||
if case .scheduledMessages = chatPresentationInterfaceState.subject {
|
||||
} else if chatPresentationInterfaceState.renderedPeer?.peerId != context.account.peerId {
|
||||
if let peer = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramSecretChat, chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0 {
|
||||
accessoryItems.append(.messageAutoremoveTimeout(peer.messageAutoremoveTimeout))
|
||||
} else if currentAutoremoveTimeout != nil && chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0 {
|
||||
accessoryItems.append(.messageAutoremoveTimeout(currentAutoremoveTimeout))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if case .scheduledMessages = chatPresentationInterfaceState.subject {
|
||||
} else {
|
||||
@ -191,24 +209,6 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte
|
||||
accessoryItems.append(.gift)
|
||||
}
|
||||
}
|
||||
|
||||
var extendedSearchLayout = false
|
||||
loop: for (_, result) in chatPresentationInterfaceState.inputQueryResults {
|
||||
if case let .contextRequestResult(peer, _) = result, peer != nil {
|
||||
extendedSearchLayout = true
|
||||
break loop
|
||||
}
|
||||
}
|
||||
if !extendedSearchLayout {
|
||||
if case .scheduledMessages = chatPresentationInterfaceState.subject {
|
||||
} else if chatPresentationInterfaceState.renderedPeer?.peerId != context.account.peerId {
|
||||
if let peer = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramSecretChat, chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0 {
|
||||
accessoryItems.append(.messageAutoremoveTimeout(peer.messageAutoremoveTimeout))
|
||||
} else if currentAutoremoveTimeout != nil && chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0 {
|
||||
accessoryItems.append(.messageAutoremoveTimeout(currentAutoremoveTimeout))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if isTextEmpty && chatPresentationInterfaceState.hasScheduledMessages && !hasForward {
|
||||
accessoryItems.append(.scheduledMessages)
|
||||
|
Loading…
x
Reference in New Issue
Block a user