Various Fixes

This commit is contained in:
Ilya Laktyushin
2021-03-15 17:16:58 +04:00
parent 666b076867
commit a605c7e31c
3 changed files with 45 additions and 15 deletions

View File

@@ -108,6 +108,14 @@ private final class VoiceChatControllerTitleNode: ASDisplayNode {
self.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.tap)))
}
override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
if point.y > 0.0 && point.y < self.frame.size.height && point.x > min(self.titleNode.frame.minX, self.infoNode.frame.minX) && point.x < max(self.recordingIconNode.frame.maxX, self.infoNode.frame.maxX) {
return true
} else {
return false
}
}
@objc private func tap() {
self.tapped?()
}
@@ -1676,9 +1684,21 @@ public final class VoiceChatController: ViewController {
self.titleNode.tapped = { [weak self] in
if let strongSelf = self, !strongSelf.titleNode.recordingIconNode.isHidden {
var ignore = false
strongSelf.controller?.forEachController { controller -> Bool in
if controller is TooltipScreen {
ignore = true
}
return true
}
guard !ignore else {
return
}
let location = strongSelf.titleNode.recordingIconNode.convert(strongSelf.titleNode.recordingIconNode.bounds, to: nil)
strongSelf.controller?.present(TooltipScreen(text: presentationData.strings.VoiceChat_RecordingInProgress, icon: nil, location: .point(location.offsetBy(dx: 1.0, dy: 0.0), .top), displayDuration: .custom(3.0), shouldDismissOnTouch: { _ in
return .dismiss(consume: false)
return .dismiss(consume: true)
}), in: .window(.root))
}
}
@@ -3418,6 +3438,9 @@ public final class VoiceChatController: ViewController {
if let controller = controller as? UndoOverlayController {
controller.dismissWithCommitAction()
}
if let controller = controller as? TooltipScreen {
controller.dismiss()
}
return true
})
}