From 0cd1770a0aee75346d91f6eaabe9502627ff4399 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sun, 2 Mar 2025 05:59:11 +0400 Subject: [PATCH] Fix message input height computation for paid messages --- .../Sources/AttachmentTextInputPanelNode.swift | 6 ++++-- submodules/TelegramUI/Sources/ChatTextInputPanelNode.swift | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/submodules/AttachmentTextInputPanelNode/Sources/AttachmentTextInputPanelNode.swift b/submodules/AttachmentTextInputPanelNode/Sources/AttachmentTextInputPanelNode.swift index 93ddd3224b..261ccc1b6d 100644 --- a/submodules/AttachmentTextInputPanelNode/Sources/AttachmentTextInputPanelNode.swift +++ b/submodules/AttachmentTextInputPanelNode/Sources/AttachmentTextInputPanelNode.swift @@ -632,8 +632,10 @@ public class AttachmentTextInputPanelNode: ASDisplayNode, TGCaptionPanelView, AS } private func calculateTextFieldMetrics(width: CGFloat, maxHeight: CGFloat, metrics: LayoutMetrics) -> (accessoryButtonsWidth: CGFloat, textFieldHeight: CGFloat) { - let textFieldInsets = self.textFieldInsets(metrics: metrics) - + var textFieldInsets = self.textFieldInsets(metrics: metrics) + if self.actionButtons.frame.width > 44.0 { + textFieldInsets.right = self.actionButtons.frame.width + } let fieldMaxHeight = textFieldMaxHeight(maxHeight, metrics: metrics) var textFieldMinHeight: CGFloat = 35.0 diff --git a/submodules/TelegramUI/Sources/ChatTextInputPanelNode.swift b/submodules/TelegramUI/Sources/ChatTextInputPanelNode.swift index 21853370d7..aa3bc0eb74 100644 --- a/submodules/TelegramUI/Sources/ChatTextInputPanelNode.swift +++ b/submodules/TelegramUI/Sources/ChatTextInputPanelNode.swift @@ -1316,7 +1316,10 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate, Ch let accessoryButtonInset = self.accessoryButtonInset let accessoryButtonSpacing = self.accessoryButtonSpacing - let textFieldInsets = self.textFieldInsets(metrics: metrics) + var textFieldInsets = self.textFieldInsets(metrics: metrics) + if self.actionButtons.frame.width > 44.0 { + textFieldInsets.right = self.actionButtons.frame.width - 2.0 + } let fieldMaxHeight = textFieldMaxHeight(maxHeight, metrics: metrics)