Skip to content

Commit 7a2df77

Browse files
committed
Various fixes
1 parent 6ecec86 commit 7a2df77

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5631,17 +5631,22 @@ final class HeaderContentComponent: Component {
56315631
func update(component: HeaderContentComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment<Empty>, transition: ComponentTransition) -> CGSize {
56325632
self.component = component
56335633

5634+
let padding: CGFloat = 10.0
5635+
56345636
let titleSize = self.title.update(
56355637
transition: transition,
56365638
component: AnyComponent(
5637-
MultilineTextComponent(text: .plain(component.attributedText), horizontalAlignment: .center)
5639+
MultilineTextComponent(
5640+
text: .plain(component.attributedText),
5641+
horizontalAlignment: .center,
5642+
maximumNumberOfLines: 2
5643+
)
56385644
),
56395645
environment: {},
5640-
containerSize: availableSize
5646+
containerSize: CGSize(width: availableSize.width - padding * 4.0, height: availableSize.height)
56415647
)
56425648

5643-
let padding: CGFloat = 10.0
5644-
let size = CGSize(width: titleSize.width + padding * 2.0, height: 19.0)
5649+
let size = CGSize(width: titleSize.width + padding * 2.0, height: titleSize.height + 4.0)
56455650

56465651
let titleFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - titleSize.width) / 2.0), y: floorToScreenPixels((size.height - titleSize.height) / 2.0) - UIScreenPixel), size: titleSize)
56475652
if let titleView = self.title.view {
@@ -5651,7 +5656,7 @@ final class HeaderContentComponent: Component {
56515656
transition.setFrame(view: titleView, frame: titleFrame)
56525657
}
56535658

5654-
self.backgroundView.update(size: size, cornerRadius: size.height / 2.0, transition: transition.containedViewLayoutTransition)
5659+
self.backgroundView.update(size: size, cornerRadius: 9.5, transition: transition.containedViewLayoutTransition)
56555660
transition.setFrame(view: self.backgroundView, frame: CGRect(origin: .zero, size: size))
56565661

56575662
return size

submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ private func infoItems(data: PeerInfoScreenData?, context: AccountContext, prese
15061506
if context.isPremium {
15071507
entities = generateTextEntities(note.text, enabledTypes: [.mention, .hashtag, .allUrl], currentEntities: entities)
15081508
}
1509-
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
1509+
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
15101510
interaction.requestLayout(animated)
15111511
}))
15121512
}

0 commit comments

Comments
 (0)