diff --git a/submodules/ContactListUI/Sources/ContactsController.swift b/submodules/ContactListUI/Sources/ContactsController.swift index 0b14205861..3b33104eed 100644 --- a/submodules/ContactListUI/Sources/ContactsController.swift +++ b/submodules/ContactListUI/Sources/ContactsController.swift @@ -67,9 +67,6 @@ private final class SortHeaderButton: HighlightableButtonNode { strongSelf.contextAction?(strongSelf.containerNode, gesture) } - self.containerNode.frame = CGRect(origin: CGPoint(), size: CGSize(width: 26.0, height: 44.0)) - self.referenceNode.frame = self.containerNode.bounds - self.update(theme: presentationData.theme, strings: presentationData.strings) } @@ -82,10 +79,15 @@ private final class SortHeaderButton: HighlightableButtonNode { self.textNode.attributedText = NSAttributedString(string: strings.Contacts_Sort, font: Font.regular(17.0), textColor: theme.rootController.navigationBar.accentTextColor) let size = self.textNode.updateLayout(CGSize(width: 100.0, height: 44.0)) self.textNode.frame = CGRect(origin: CGPoint(x: 0.0, y: floorToScreenPixels((44.0 - size.height) / 2.0)), size: size) + + self.containerNode.frame = CGRect(origin: CGPoint(), size: CGSize(width: size.width, height: 44.0)) + self.referenceNode.frame = self.containerNode.bounds } override func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize { - return CGSize(width: 44.0, height: 44.0) + let size = self.textNode.updateLayout(CGSize(width: 100.0, height: 44.0)) + + return CGSize(width: size.width, height: 44.0) } func onLayout() { diff --git a/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift b/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift index ba29ef4915..91e304a342 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift @@ -1083,15 +1083,25 @@ private class StorageUsageClearProgressOverlayNode: ASDisplayNode, ActionSheetGr self.descriptionTextNode.attributedText = NSAttributedString(string: self.presentationData.strings.ClearCache_KeepOpenedDescription, font: Font.regular(15.0), textColor: self.presentationData.theme.actionSheet.secondaryTextColor) let descriptionTextSize = self.descriptionTextNode.updateLayout(CGSize(width: size.width - inset * 3.0, height: size.height)) - let descriptionTextFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - descriptionTextSize.width) / 2.0), y: progressFrame.minY - spacing - 9.0 - descriptionTextSize.height), size: descriptionTextSize) - self.descriptionTextNode.frame = descriptionTextFrame - + var descriptionTextFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - descriptionTextSize.width) / 2.0), y: progressFrame.minY - spacing - 9.0 - descriptionTextSize.height), size: descriptionTextSize) + self.progressTextNode.attributedText = NSAttributedString(string: self.presentationData.strings.ClearCache_Progress(Int(progress * 100.0)).string, font: Font.with(size: 17.0, design: .regular, weight: .bold, traits: [.monospacedNumbers]), textColor: self.presentationData.theme.actionSheet.primaryTextColor) let progressTextSize = self.progressTextNode.updateLayout(size) - let progressTextFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - progressTextSize.width) / 2.0), y: descriptionTextFrame.minY - spacing - progressTextSize.height), size: progressTextSize) - self.progressTextNode.frame = progressTextFrame + var progressTextFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - progressTextSize.width) / 2.0), y: descriptionTextFrame.minY - spacing - progressTextSize.height), size: progressTextSize) let availableHeight = progressTextFrame.minY + if availableHeight < 100.0 { + let offset = availableHeight / 2.0 - spacing + descriptionTextFrame = descriptionTextFrame.offsetBy(dx: 0.0, dy: -offset) + progressTextFrame = progressTextFrame.offsetBy(dx: 0.0, dy: -offset) + self.animationNode.alpha = 0.0 + } else { + self.animationNode.alpha = 1.0 + } + + self.progressTextNode.frame = progressTextFrame + self.descriptionTextNode.frame = descriptionTextFrame + let imageSide = min(160.0, availableHeight - 30.0) let imageSize = CGSize(width: imageSide, height: imageSide) diff --git a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift index 5392a60589..3b2ec15c7e 100644 --- a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift @@ -991,7 +991,11 @@ private func infoItems(data: PeerInfoScreenData?, context: AccountContext, prese } if let aboutText = aboutText { - items[.peerInfo]!.append(PeerInfoScreenLabeledValueItem(id: ItemAbout, label: presentationData.strings.Channel_Info_Description, text: aboutText, textColor: .primary, textBehavior: .multiLine(maxLines: 100, enabledEntities: enabledPublicBioEntities), action: nil, longTapAction: bioContextAction, linkItemAction: bioLinkAction, requestLayout: { + var enabledEntities = enabledPublicBioEntities + if case .group = channel.info { + enabledEntities = enabledPrivateBioEntities + } + items[.peerInfo]!.append(PeerInfoScreenLabeledValueItem(id: ItemAbout, label: presentationData.strings.Channel_Info_Description, text: aboutText, textColor: .primary, textBehavior: .multiLine(maxLines: 100, enabledEntities: enabledEntities), action: nil, longTapAction: bioContextAction, linkItemAction: bioLinkAction, requestLayout: { interaction.requestLayout() })) } @@ -1041,7 +1045,7 @@ private func infoItems(data: PeerInfoScreenData?, context: AccountContext, prese } if let aboutText = aboutText { - items[.peerInfo]!.append(PeerInfoScreenLabeledValueItem(id: 0, label: presentationData.strings.Channel_Info_Description, text: aboutText, textColor: .primary, textBehavior: .multiLine(maxLines: 100, enabledEntities: enabledPublicBioEntities), action: nil, longTapAction: bioContextAction, linkItemAction: bioLinkAction, requestLayout: { + items[.peerInfo]!.append(PeerInfoScreenLabeledValueItem(id: 0, label: presentationData.strings.Channel_Info_Description, text: aboutText, textColor: .primary, textBehavior: .multiLine(maxLines: 100, enabledEntities: enabledPrivateBioEntities), action: nil, longTapAction: bioContextAction, linkItemAction: bioLinkAction, requestLayout: { interaction.requestLayout() })) } diff --git a/submodules/TextFormat/Sources/GenerateTextEntities.swift b/submodules/TextFormat/Sources/GenerateTextEntities.swift index b65d3c72bd..dc52d1d25b 100644 --- a/submodules/TextFormat/Sources/GenerateTextEntities.swift +++ b/submodules/TextFormat/Sources/GenerateTextEntities.swift @@ -193,7 +193,7 @@ public func generateTextEntities(_ text: String, enabledTypes: EnabledEntityType guard let host = url.host?.lowercased() else { return } - if host == "telegram.org" || host == "t.me" { + if ["telegram.org", "www.telegram.org", "t.me", "www.t.me"].contains(host) { } else { return }