From 7a2df7750c1082e593e7c184ff2d0167c9284c75 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sat, 4 Oct 2025 00:52:36 +0400 Subject: [PATCH] Various fixes --- .../GiftViewScreen/Sources/GiftViewScreen.swift | 15 ++++++++++----- .../PeerInfoScreen/Sources/PeerInfoScreen.swift | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift b/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift index 3ffec47378..db72c7cb89 100644 --- a/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift +++ b/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift @@ -5631,17 +5631,22 @@ final class HeaderContentComponent: Component { func update(component: HeaderContentComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment, transition: ComponentTransition) -> CGSize { self.component = component + let padding: CGFloat = 10.0 + let titleSize = self.title.update( transition: transition, component: AnyComponent( - MultilineTextComponent(text: .plain(component.attributedText), horizontalAlignment: .center) + MultilineTextComponent( + text: .plain(component.attributedText), + horizontalAlignment: .center, + maximumNumberOfLines: 2 + ) ), environment: {}, - containerSize: availableSize + containerSize: CGSize(width: availableSize.width - padding * 4.0, height: availableSize.height) ) - let padding: CGFloat = 10.0 - let size = CGSize(width: titleSize.width + padding * 2.0, height: 19.0) + let size = CGSize(width: titleSize.width + padding * 2.0, height: titleSize.height + 4.0) let titleFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - titleSize.width) / 2.0), y: floorToScreenPixels((size.height - titleSize.height) / 2.0) - UIScreenPixel), size: titleSize) if let titleView = self.title.view { @@ -5651,7 +5656,7 @@ final class HeaderContentComponent: Component { transition.setFrame(view: titleView, frame: titleFrame) } - self.backgroundView.update(size: size, cornerRadius: size.height / 2.0, transition: transition.containedViewLayoutTransition) + self.backgroundView.update(size: size, cornerRadius: 9.5, transition: transition.containedViewLayoutTransition) transition.setFrame(view: self.backgroundView, frame: CGRect(origin: .zero, size: size)) return size diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift index 0a9f7b7800..482d6a7a7b 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift @@ -1506,7 +1506,7 @@ private func infoItems(data: PeerInfoScreenData?, context: AccountContext, prese if context.isPremium { entities = generateTextEntities(note.text, enabledTypes: [.mention, .hashtag, .allUrl], currentEntities: entities) } - items[currentPeerInfoSection]!.append(PeerInfoScreenLabeledValueItem(id: 0, label: presentationData.strings.PeerInfo_Notes, rightLabel: presentationData.strings.PeerInfo_NotesInfo, text: note.text, entities: entities, handleSpoilers: true, textColor: .primary, textBehavior: .multiLine(maxLines: 100, enabledEntities: []), action: nil, linkItemAction: bioLinkAction, button: nil, contextAction: noteContextAction, requestLayout: { animated in + items[currentPeerInfoSection]!.append(PeerInfoScreenLabeledValueItem(id: 1, label: presentationData.strings.PeerInfo_Notes, rightLabel: presentationData.strings.PeerInfo_NotesInfo, text: note.text, entities: entities, handleSpoilers: true, textColor: .primary, textBehavior: .multiLine(maxLines: 100, enabledEntities: []), action: nil, linkItemAction: bioLinkAction, button: nil, contextAction: noteContextAction, requestLayout: { animated in interaction.requestLayout(animated) })) }