Merge commit '67e13e5947606a7e02b264d3d6fea99395a21595'

This commit is contained in:
Peter 2019-07-30 20:45:48 +03:00
commit 336e79ca93
2 changed files with 14 additions and 7 deletions

View File

@ -240,6 +240,8 @@ public final class ChatController: TelegramController, GalleryHiddenMediaTarget,
private weak var slowmodeTooltipController: ChatSlowmodeHintController?
private weak var sendMessageActionsController: ChatSendMessageActionSheetController?
private var screenCaptureEventsDisposable: Disposable?
private let chatAdditionalDataDisposable = MetaDisposable()
@ -3655,6 +3657,7 @@ public final class ChatController: TelegramController, GalleryHiddenMediaTarget,
strongSelf.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .all)
}
})
strongSelf.sendMessageActionsController = controller
strongSelf.presentInGlobalOverlay(controller, with: nil)
}
}, statuses: ChatPanelInterfaceInteractionStatuses(editingMessage: self.editingMessage.get(), startingBot: self.startingBot.get(), unblockingPeer: self.unblockingPeer.get(), searching: self.searching.get(), loadingMessage: self.loadingMessage.get()))
@ -4026,6 +4029,8 @@ public final class ChatController: TelegramController, GalleryHiddenMediaTarget,
controller.dismissWithCommitAction()
}
})
self.sendMessageActionsController?.dismiss()
}
private func saveInterfaceState(includeScrollState: Bool = true) {

View File

@ -203,13 +203,15 @@ final class ChatSendMessageActionSheetControllerNode: ViewControllerTracingNode,
if let attributedText = textInputNode.attributedText, !attributedText.string.isEmpty {
self.fromMessageTextNode.attributedText = attributedText
if let toAttributedText = self.fromMessageTextNode.attributedText?.mutableCopy() as? NSMutableAttributedString {
toAttributedText.addAttribute(NSAttributedStringKey.foregroundColor, value: self.presentationData.theme.chat.message.outgoing.primaryTextColor, range: NSMakeRange(0, (toAttributedText.string as NSString).length))
self.toMessageTextNode.attributedText = toAttributedText
}
} else {
self.fromMessageTextNode.attributedText = NSAttributedString(string: self.presentationData.strings.ForwardedMessages(Int32(forwardedCount ?? 0)), attributes: [NSAttributedStringKey.foregroundColor: self.presentationData.theme.chat.message.outgoing.primaryTextColor, NSAttributedStringKey.font: Font.regular(self.presentationData.fontSize.baseDisplaySize)])
}
if let toAttributedText = self.fromMessageTextNode.attributedText?.mutableCopy() as? NSMutableAttributedString {
toAttributedText.addAttribute(NSAttributedStringKey.foregroundColor, value: self.presentationData.theme.chat.message.outgoing.primaryTextColor, range: NSMakeRange(0, (toAttributedText.string as NSString).length))
self.toMessageTextNode.attributedText = toAttributedText
self.fromMessageTextNode.attributedText = NSAttributedString(string: self.presentationData.strings.Conversation_InputTextPlaceholder, attributes: [NSAttributedStringKey.foregroundColor: self.presentationData.theme.chat.inputPanel.inputPlaceholderColor, NSAttributedStringKey.font: Font.regular(self.presentationData.fontSize.baseDisplaySize)])
self.toMessageTextNode.attributedText = NSAttributedString(string: self.presentationData.strings.ForwardedMessages(Int32(forwardedCount ?? 0)), attributes: [NSAttributedStringKey.foregroundColor: self.presentationData.theme.chat.message.outgoing.primaryTextColor, NSAttributedStringKey.font: Font.regular(self.presentationData.fontSize.baseDisplaySize)])
}
self.messageBackgroundNode.contentMode = .scaleToFill
@ -536,7 +538,7 @@ final class ChatSendMessageActionSheetControllerNode: ViewControllerTracingNode,
}
if self.textInputNode.textView.numberOfLines == 1 || self.textInputNode.textView.attributedText.string.isEmpty {
let textWidth = min(self.fromMessageTextNode.textView.sizeThatFits(layout.size).width + 36.0, messageFrame.width)
let textWidth = min(self.toMessageTextNode.textView.sizeThatFits(layout.size).width + 36.0, messageFrame.width)
messageFrame.origin.x += messageFrame.width - textWidth
messageFrame.size.width = textWidth
}