mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-31 23:47:01 +00:00
Various Improvements
This commit is contained in:
parent
e674cfbfa6
commit
2a1d8af744
@ -217,7 +217,7 @@ public class InvisibleInkDustNode: ASDisplayNode {
|
||||
square += Float(rect.width * rect.height)
|
||||
}
|
||||
|
||||
self.emitter?.birthRate = square * 0.3
|
||||
self.emitter?.birthRate = square * 0.4
|
||||
}
|
||||
|
||||
public func update(size: CGSize, color: UIColor, rects: [CGRect]) {
|
||||
|
@ -404,7 +404,7 @@ class ChatMessageTextBubbleContentNode: ChatMessageBubbleContentNode {
|
||||
strongSelf.dustNode = dustNode
|
||||
strongSelf.insertSubnode(dustNode, aboveSubnode: spoilerTextNode)
|
||||
}
|
||||
dustNode.update(size: textFrame.size, color: messageTheme.secondaryTextColor, rects: textLayout.spoilers.map { $0.offsetBy(dx: 3.0, dy: 3.0).insetBy(dx: 0.0, dy: 1.0) })
|
||||
dustNode.update(size: textFrame.size, color: messageTheme.secondaryTextColor, rects: textLayout.spoilers.map { $0.offsetBy(dx: 3.0, dy: 3.0).insetBy(dx: 1.0, dy: 1.0) })
|
||||
dustNode.frame = textFrame.insetBy(dx: -3.0, dy: -3.0).offsetBy(dx: 0.0, dy: 3.0)
|
||||
} else if let spoilerTextNode = strongSelf.spoilerTextNode {
|
||||
strongSelf.spoilerTextNode = nil
|
||||
|
@ -12,15 +12,16 @@ public func translateText(context: AccountContext, text: String) {
|
||||
return
|
||||
}
|
||||
if #available(iOS 15.0, *) {
|
||||
let textField = UITextField()
|
||||
textField.text = text
|
||||
let textView = UITextView()
|
||||
textView.text = text
|
||||
textView.isEditable = false
|
||||
if let navigationController = context.sharedContext.mainWindow?.viewController as? NavigationController, let topController = navigationController.topViewController as? ViewController {
|
||||
topController.view.addSubview(textField)
|
||||
textField.selectAll(nil)
|
||||
textField.perform(NSSelectorFromString(["_", "trans", "late:"].joined(separator: "")), with: nil)
|
||||
topController.view.addSubview(textView)
|
||||
textView.selectAll(nil)
|
||||
textView.perform(NSSelectorFromString(["_", "trans", "late:"].joined(separator: "")), with: nil)
|
||||
|
||||
DispatchQueue.main.async {
|
||||
textField.removeFromSuperview()
|
||||
textView.removeFromSuperview()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user