mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Merge commit '34a29f6dec4c067d8af0b49fcdde2eeec8893739'
This commit is contained in:
commit
5e9ea78393
@ -679,7 +679,7 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
|
|||||||
if let previousAdditionalSideInsets = previousAdditionalSideInsets, previousAdditionalSideInsets.right != additionalSideInsets.right {
|
if let previousAdditionalSideInsets = previousAdditionalSideInsets, previousAdditionalSideInsets.right != additionalSideInsets.right {
|
||||||
additionalOffset = (previousAdditionalSideInsets.right - additionalSideInsets.right) / 3.0
|
additionalOffset = (previousAdditionalSideInsets.right - additionalSideInsets.right) / 3.0
|
||||||
|
|
||||||
if case let .animated(duration, _) = transition {
|
if case .animated = transition {
|
||||||
transition = .animated(duration: 0.2, curve: .easeInOut)
|
transition = .animated(duration: 0.2, curve: .easeInOut)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1777,17 +1777,25 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
|
|||||||
|
|
||||||
func editableTextNodeTarget(forAction action: Selector) -> ASEditableTextNodeTargetForAction? {
|
func editableTextNodeTarget(forAction action: Selector) -> ASEditableTextNodeTargetForAction? {
|
||||||
if action == Selector(("_accessibilitySpeak:")) {
|
if action == Selector(("_accessibilitySpeak:")) {
|
||||||
if let textInputNode = self.textInputNode, textInputNode.selectedRange.length > 0 {
|
if case .format = self.inputMenu.state {
|
||||||
|
return ASEditableTextNodeTargetForAction(target: nil)
|
||||||
|
} else if let textInputNode = self.textInputNode, textInputNode.selectedRange.length > 0 {
|
||||||
return ASEditableTextNodeTargetForAction(target: self)
|
return ASEditableTextNodeTargetForAction(target: self)
|
||||||
} else {
|
} else {
|
||||||
return ASEditableTextNodeTargetForAction(target: nil)
|
return ASEditableTextNodeTargetForAction(target: nil)
|
||||||
}
|
}
|
||||||
} else if action == Selector("_accessibilitySpeakLanguageSelection:") {
|
} else if action == Selector(("_accessibilitySpeakSpellOut:")) {
|
||||||
return ASEditableTextNodeTargetForAction(target: nil)
|
if case .format = self.inputMenu.state {
|
||||||
} else if action == Selector("_accessibilityPauseSpeaking:") {
|
return ASEditableTextNodeTargetForAction(target: nil)
|
||||||
return ASEditableTextNodeTargetForAction(target: nil)
|
} else if let textInputNode = self.textInputNode, textInputNode.selectedRange.length > 0 {
|
||||||
|
return nil
|
||||||
|
} else {
|
||||||
|
return ASEditableTextNodeTargetForAction(target: nil)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if action == Selector(("_showTextStyleOptions:")) {
|
else if action == Selector("_accessibilitySpeakLanguageSelection:") || action == Selector("_accessibilityPauseSpeaking:") || action == Selector("_accessibilitySpeakSentence:") {
|
||||||
|
return ASEditableTextNodeTargetForAction(target: nil)
|
||||||
|
} else if action == Selector(("_showTextStyleOptions:")) {
|
||||||
if case .general = self.inputMenu.state {
|
if case .general = self.inputMenu.state {
|
||||||
if let textInputNode = self.textInputNode, textInputNode.attributedText == nil || textInputNode.attributedText!.length == 0 || textInputNode.selectedRange.length == 0 {
|
if let textInputNode = self.textInputNode, textInputNode.attributedText == nil || textInputNode.attributedText!.length == 0 || textInputNode.selectedRange.length == 0 {
|
||||||
return ASEditableTextNodeTargetForAction(target: nil)
|
return ASEditableTextNodeTargetForAction(target: nil)
|
||||||
@ -1816,6 +1824,13 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
|
|||||||
return (current, inputMode)
|
return (current, inputMode)
|
||||||
}
|
}
|
||||||
speakText(text)
|
speakText(text)
|
||||||
|
|
||||||
|
if #available(iOS 13.0, *) {
|
||||||
|
UIMenuController.shared.hideMenu()
|
||||||
|
} else {
|
||||||
|
UIMenuController.shared.isMenuVisible = false
|
||||||
|
UIMenuController.shared.update()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func _showTextStyleOptions(_ sender: Any) {
|
@objc func _showTextStyleOptions(_ sender: Any) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user