diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index accd40bc2e..ffa03d885d 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -12804,7 +12804,7 @@ Sorry for the inconvenience."; "SendStarReactions.SectionTop" = "Top Senders"; "SendStarReactions.ShowMyselfInTop" = "Show me in Top Senders"; "SendStarReactions.SendButtonTitle" = "Send # %@"; -"SendStarReactions.TermsOfServiceFooter" = "By sending Stars you agree to the [Terms of Service](https://telegram.org/privacy)"; +"SendStarReactions.TermsOfServiceFooter" = "By sending Stars you agree to the [Terms of Service](https://telegram.org/tos/stars)"; "PeerInfo.AllowedReactions.StarReactions" = "Enable Paid Reactions"; "PeerInfo.AllowedReactions.StarReactionsFooter" = "Switch this on to let your subscribers set paid reactions with Telegram Stars, which you will be able to withdraw later as TON. [Learn More >](https://telegram.org/privacy)"; diff --git a/submodules/BrowserUI/Sources/BrowserPdfContent.swift b/submodules/BrowserUI/Sources/BrowserPdfContent.swift index 780678c4d6..4b67b6849a 100644 --- a/submodules/BrowserUI/Sources/BrowserPdfContent.swift +++ b/submodules/BrowserUI/Sources/BrowserPdfContent.swift @@ -131,7 +131,6 @@ final class BrowserPdfContent: UIView, BrowserContent, UIScrollViewDelegate, PDF private var searchResultsCount: Int = 0 private var searchResults: [PDFSelection] = [] private var searchCompletion: ((Int) -> Void)? - private var searchDimmingView: UIView? private let matchColor = UIColor(rgb: 0xd4d4d, alpha: 0.2) private let selectedColor = UIColor(rgb: 0xffe438) @@ -299,9 +298,6 @@ final class BrowserPdfContent: UIView, BrowserContent, UIScrollViewDelegate, PDF let pdfViewFrame = CGRect(origin: CGPoint(x: insets.left, y: insets.top), size: CGSize(width: size.width - insets.left - insets.right, height: size.height - insets.top - insets.bottom)) transition.setFrame(view: self.pdfView, frame: pdfViewFrame) - if let searchDimmingView = self.searchDimmingView { - transition.setFrame(view: searchDimmingView, frame: CGRect(origin: .zero, size: self.pdfView.bounds.size)) - } if isFirstTime { self.pdfView.setNeedsLayout() diff --git a/submodules/BrowserUI/Sources/BrowserSearchBarComponent.swift b/submodules/BrowserUI/Sources/BrowserSearchBarComponent.swift index 538e42344e..9678ab3b06 100644 --- a/submodules/BrowserUI/Sources/BrowserSearchBarComponent.swift +++ b/submodules/BrowserUI/Sources/BrowserSearchBarComponent.swift @@ -84,10 +84,6 @@ final class SearchBarContentComponent: Component { private var params: Params? private var component: SearchBarContentComponent? - public var wantsDisplayBelowKeyboard: Bool { - return self.textField != nil - } - init() { self.backgroundLayer = SimpleLayer() @@ -177,9 +173,10 @@ final class SearchBarContentComponent: Component { private func activateTextInput() { if self.textField == nil, let textFrame = self.textFrame { let backgroundFrame = self.backgroundLayer.frame - let textFieldFrame = CGRect(origin: CGPoint(x: textFrame.minX, y: backgroundFrame.minY), size: CGSize(width: backgroundFrame.maxX - textFrame.minX, height: backgroundFrame.height)) + let textFieldFrame = CGRect(origin: CGPoint(x: textFrame.minX, y: backgroundFrame.minY), size: CGSize(width: backgroundFrame.maxX - textFrame.minX - 32.0, height: backgroundFrame.height)) let textField = SearchTextField(frame: textFieldFrame) + textField.clipsToBounds = true textField.autocorrectionType = .no textField.returnKeyType = .search self.textField = textField diff --git a/submodules/TelegramUI/Components/Chat/ChatSendStarsScreen/BUILD b/submodules/TelegramUI/Components/Chat/ChatSendStarsScreen/BUILD index 30d8e6c87f..1cbadf2f42 100644 --- a/submodules/TelegramUI/Components/Chat/ChatSendStarsScreen/BUILD +++ b/submodules/TelegramUI/Components/Chat/ChatSendStarsScreen/BUILD @@ -32,6 +32,7 @@ swift_library( "//submodules/AvatarNode", "//submodules/Components/BundleIconComponent", "//submodules/CheckNode", + "//submodules/TextFormat", ], visibility = [ "//visibility:public", diff --git a/submodules/TelegramUI/Components/Chat/ChatSendStarsScreen/Sources/ChatSendStarsScreen.swift b/submodules/TelegramUI/Components/Chat/ChatSendStarsScreen/Sources/ChatSendStarsScreen.swift index 456f1e8a3f..b4820d474b 100644 --- a/submodules/TelegramUI/Components/Chat/ChatSendStarsScreen/Sources/ChatSendStarsScreen.swift +++ b/submodules/TelegramUI/Components/Chat/ChatSendStarsScreen/Sources/ChatSendStarsScreen.swift @@ -19,6 +19,7 @@ import RoundedRectWithTailPath import AvatarNode import BundleIconComponent import CheckNode +import TextFormat private final class BalanceComponent: CombinedComponent { let context: AccountContext @@ -1808,12 +1809,26 @@ private final class ChatSendStarsScreenComponent: Component { body: MarkdownAttributeSet(font: Font.regular(13.0), textColor: environment.theme.list.itemSecondaryTextColor), bold: MarkdownAttributeSet(font: Font.semibold(13.0), textColor: environment.theme.list.itemSecondaryTextColor), link: MarkdownAttributeSet(font: Font.regular(13.0), textColor: environment.theme.list.itemAccentColor), - linkAttribute: { url in - return ("URL", url) + linkAttribute: { contents in + return (TelegramTextAttributes.URL, contents) } )), horizontalAlignment: .center, - maximumNumberOfLines: 0 + maximumNumberOfLines: 0, + highlightColor: environment.theme.list.itemAccentColor.withAlphaComponent(0.2), + highlightAction: { attributes in + if let _ = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] { + return NSAttributedString.Key(rawValue: TelegramTextAttributes.URL) + } else { + return nil + } + }, + tapAction: { [weak self] attributes, _ in + if let controller = self?.environment?.controller(), let navigationController = controller.navigationController as? NavigationController, let url = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] as? String { + let presentationData = component.context.sharedContext.currentPresentationData.with { $0 } + component.context.sharedContext.openExternalUrl(context: component.context, urlContext: .generic, url: url, forceExternal: false, presentationData: presentationData, navigationController: navigationController, dismissInput: {}) + } + } )), environment: {}, containerSize: CGSize(width: availableSize.width - sideInset, height: 1000.0)