Small fixes

This commit is contained in:
Ali 2020-04-16 17:03:50 +04:00
parent 5d638ce4d2
commit eed8cb0b3f
3 changed files with 21 additions and 2 deletions

View File

@ -633,6 +633,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
} }
let _ = updateMessageReactionsInteractively(postbox: strongSelf.context.account.postbox, messageId: message.id, reaction: value).start() let _ = updateMessageReactionsInteractively(postbox: strongSelf.context.account.postbox, messageId: message.id, reaction: value).start()
} }
strongSelf.forEachController({ controller in
if let controller = controller as? TooltipScreen {
controller.dismiss()
}
return true
})
strongSelf.window?.presentInGlobalOverlay(controller) strongSelf.window?.presentInGlobalOverlay(controller)
}) })
} }
@ -1512,6 +1518,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
let controller = ContextController(account: strongSelf.context.account, presentationData: strongSelf.presentationData, source: .extracted(ChatMessageContextExtractedContentSource(chatNode: strongSelf.chatDisplayNode, message: message)), items: .single(actions), reactionItems: [], recognizer: nil) let controller = ContextController(account: strongSelf.context.account, presentationData: strongSelf.presentationData, source: .extracted(ChatMessageContextExtractedContentSource(chatNode: strongSelf.chatDisplayNode, message: message)), items: .single(actions), reactionItems: [], recognizer: nil)
strongSelf.currentContextController = controller strongSelf.currentContextController = controller
strongSelf.forEachController({ controller in
if let controller = controller as? TooltipScreen {
controller.dismiss()
}
return true
})
strongSelf.window?.presentInGlobalOverlay(controller) strongSelf.window?.presentInGlobalOverlay(controller)
}) })
} else { } else {
@ -1583,6 +1595,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
let controller = ContextController(account: strongSelf.context.account, presentationData: strongSelf.presentationData, source: .extracted(ChatMessageContextExtractedContentSource(chatNode: strongSelf.chatDisplayNode, message: topMessage)), items: .single(actions), reactionItems: [], recognizer: nil) let controller = ContextController(account: strongSelf.context.account, presentationData: strongSelf.presentationData, source: .extracted(ChatMessageContextExtractedContentSource(chatNode: strongSelf.chatDisplayNode, message: topMessage)), items: .single(actions), reactionItems: [], recognizer: nil)
strongSelf.currentContextController = controller strongSelf.currentContextController = controller
strongSelf.forEachController({ controller in
if let controller = controller as? TooltipScreen {
controller.dismiss()
}
return true
})
strongSelf.window?.presentInGlobalOverlay(controller) strongSelf.window?.presentInGlobalOverlay(controller)
}) })
} }

View File

@ -1498,7 +1498,7 @@ class ChatMessagePollBubbleContentNode: ChatMessageBubbleContentNode {
} }
timerTransition.updateAlpha(node: strongSelf.solutionButtonNode, alpha: 1.0) timerTransition.updateAlpha(node: strongSelf.solutionButtonNode, alpha: 1.0)
} }
strongSelf.solutionButtonNode.update(size: solutionButtonSize, theme: item.presentationData.theme.theme, incoming: item.message.flags.contains(.Incoming)) strongSelf.solutionButtonNode.update(size: solutionButtonSize, theme: item.presentationData.theme.theme, incoming: incoming)
} else if !strongSelf.solutionButtonNode.alpha.isZero { } else if !strongSelf.solutionButtonNode.alpha.isZero {
let timerTransition: ContainedViewLayoutTransition let timerTransition: ContainedViewLayoutTransition
if animation.isAnimated { if animation.isAnimated {

View File

@ -205,7 +205,8 @@ private final class TooltipScreenNode: ViewControllerTracingNode {
} }
self.isArrowInverted = invertArrow self.isArrowInverted = invertArrow
case .top: case .top:
backgroundFrame = CGRect(origin: CGPoint(x: sideInset, y: layout.insets(options: [.statusBar]).top + 13.0), size: CGSize(width: layout.size.width - sideInset * 2.0, height: backgroundHeight)) let backgroundWidth = containerWidth
backgroundFrame = CGRect(origin: CGPoint(x: floor((layout.size.width - backgroundWidth) / 2.0), y: layout.insets(options: [.statusBar]).top + 13.0), size: CGSize(width: backgroundWidth, height: backgroundHeight))
} }
transition.updateFrame(node: self.containerNode, frame: backgroundFrame) transition.updateFrame(node: self.containerNode, frame: backgroundFrame)