mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-05 05:51:42 +00:00
Merge commit '7a2df7750c1082e593e7c184ff2d0167c9284c75' into beta
This commit is contained in:
commit
74d46c2bcb
@ -5631,17 +5631,22 @@ final class HeaderContentComponent: Component {
|
|||||||
func update(component: HeaderContentComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment<Empty>, transition: ComponentTransition) -> CGSize {
|
func update(component: HeaderContentComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment<Empty>, transition: ComponentTransition) -> CGSize {
|
||||||
self.component = component
|
self.component = component
|
||||||
|
|
||||||
|
let padding: CGFloat = 10.0
|
||||||
|
|
||||||
let titleSize = self.title.update(
|
let titleSize = self.title.update(
|
||||||
transition: transition,
|
transition: transition,
|
||||||
component: AnyComponent(
|
component: AnyComponent(
|
||||||
MultilineTextComponent(text: .plain(component.attributedText), horizontalAlignment: .center)
|
MultilineTextComponent(
|
||||||
|
text: .plain(component.attributedText),
|
||||||
|
horizontalAlignment: .center,
|
||||||
|
maximumNumberOfLines: 2
|
||||||
|
)
|
||||||
),
|
),
|
||||||
environment: {},
|
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: titleSize.height + 4.0)
|
||||||
let size = CGSize(width: titleSize.width + padding * 2.0, height: 19.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)
|
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 {
|
if let titleView = self.title.view {
|
||||||
@ -5651,7 +5656,7 @@ final class HeaderContentComponent: Component {
|
|||||||
transition.setFrame(view: titleView, frame: titleFrame)
|
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))
|
transition.setFrame(view: self.backgroundView, frame: CGRect(origin: .zero, size: size))
|
||||||
|
|
||||||
return size
|
return size
|
||||||
|
|||||||
@ -1506,7 +1506,7 @@ private func infoItems(data: PeerInfoScreenData?, context: AccountContext, prese
|
|||||||
if context.isPremium {
|
if context.isPremium {
|
||||||
entities = generateTextEntities(note.text, enabledTypes: [.mention, .hashtag, .allUrl], currentEntities: entities)
|
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)
|
interaction.requestLayout(animated)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user