mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Merge commit 'b261e67c34f1ddef7292334bfb0e76d0ebcce6e7'
This commit is contained in:
commit
4fbcfa7925
@ -395,7 +395,16 @@ class ChatListStorageInfoItemNode: ItemListRevealOptionsItemNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let arrowIsHidden = strongSelf.arrowNode.isHidden
|
let arrowIsHidden = strongSelf.arrowNode.isHidden
|
||||||
|
var hasCloseButton = false
|
||||||
if case .xmasPremiumGift = item.notice {
|
if case .xmasPremiumGift = item.notice {
|
||||||
|
hasCloseButton = true
|
||||||
|
} else if case .setupBirthday = item.notice {
|
||||||
|
hasCloseButton = true
|
||||||
|
} else if case .birthdayPremiumGift = item.notice {
|
||||||
|
hasCloseButton = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if hasCloseButton {
|
||||||
strongSelf.arrowNode.isHidden = true
|
strongSelf.arrowNode.isHidden = true
|
||||||
|
|
||||||
let closeButton: HighlightableButtonNode
|
let closeButton: HighlightableButtonNode
|
||||||
|
@ -852,6 +852,98 @@ public extension TelegramEngine.EngineData.Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public struct PersonalPhoto: TelegramEngineDataItem, TelegramEngineMapKeyDataItem, PostboxViewDataItem {
|
||||||
|
public typealias Result = EnginePeerCachedInfoItem<TelegramMediaImage?>
|
||||||
|
|
||||||
|
fileprivate var id: EnginePeer.Id
|
||||||
|
public var mapKey: EnginePeer.Id {
|
||||||
|
return self.id
|
||||||
|
}
|
||||||
|
|
||||||
|
public init(id: EnginePeer.Id) {
|
||||||
|
self.id = id
|
||||||
|
}
|
||||||
|
|
||||||
|
var key: PostboxViewKey {
|
||||||
|
return .cachedPeerData(peerId: self.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
func extract(view: PostboxView) -> Result {
|
||||||
|
guard let view = view as? CachedPeerDataView else {
|
||||||
|
preconditionFailure()
|
||||||
|
}
|
||||||
|
if let cachedData = view.cachedPeerData as? CachedUserData {
|
||||||
|
if case let .known(value) = cachedData.personalPhoto {
|
||||||
|
return .known(value)
|
||||||
|
} else {
|
||||||
|
return .unknown
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return .unknown
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public struct PublicPhoto: TelegramEngineDataItem, TelegramEngineMapKeyDataItem, PostboxViewDataItem {
|
||||||
|
public typealias Result = EnginePeerCachedInfoItem<TelegramMediaImage?>
|
||||||
|
|
||||||
|
fileprivate var id: EnginePeer.Id
|
||||||
|
public var mapKey: EnginePeer.Id {
|
||||||
|
return self.id
|
||||||
|
}
|
||||||
|
|
||||||
|
public init(id: EnginePeer.Id) {
|
||||||
|
self.id = id
|
||||||
|
}
|
||||||
|
|
||||||
|
var key: PostboxViewKey {
|
||||||
|
return .cachedPeerData(peerId: self.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
func extract(view: PostboxView) -> Result {
|
||||||
|
guard let view = view as? CachedPeerDataView else {
|
||||||
|
preconditionFailure()
|
||||||
|
}
|
||||||
|
if let cachedData = view.cachedPeerData as? CachedUserData {
|
||||||
|
if case let .known(value) = cachedData.fallbackPhoto {
|
||||||
|
return .known(value)
|
||||||
|
} else {
|
||||||
|
return .unknown
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return .unknown
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public struct Birthday: TelegramEngineDataItem, TelegramEngineMapKeyDataItem, PostboxViewDataItem {
|
||||||
|
public typealias Result = TelegramBirthday?
|
||||||
|
|
||||||
|
fileprivate var id: EnginePeer.Id
|
||||||
|
public var mapKey: EnginePeer.Id {
|
||||||
|
return self.id
|
||||||
|
}
|
||||||
|
|
||||||
|
public init(id: EnginePeer.Id) {
|
||||||
|
self.id = id
|
||||||
|
}
|
||||||
|
|
||||||
|
var key: PostboxViewKey {
|
||||||
|
return .cachedPeerData(peerId: self.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
func extract(view: PostboxView) -> Result {
|
||||||
|
guard let view = view as? CachedPeerDataView else {
|
||||||
|
preconditionFailure()
|
||||||
|
}
|
||||||
|
if let cachedData = view.cachedPeerData as? CachedUserData {
|
||||||
|
return cachedData.birthday
|
||||||
|
} else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public struct CanViewStats: TelegramEngineDataItem, TelegramEngineMapKeyDataItem, PostboxViewDataItem {
|
public struct CanViewStats: TelegramEngineDataItem, TelegramEngineMapKeyDataItem, PostboxViewDataItem {
|
||||||
public typealias Result = Bool
|
public typealias Result = Bool
|
||||||
|
|
||||||
@ -1668,34 +1760,5 @@ public extension TelegramEngine.EngineData.Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct Birthday: TelegramEngineDataItem, TelegramEngineMapKeyDataItem, PostboxViewDataItem {
|
|
||||||
public typealias Result = TelegramBirthday?
|
|
||||||
|
|
||||||
fileprivate var id: EnginePeer.Id
|
|
||||||
public var mapKey: EnginePeer.Id {
|
|
||||||
return self.id
|
|
||||||
}
|
|
||||||
|
|
||||||
public init(id: EnginePeer.Id) {
|
|
||||||
self.id = id
|
|
||||||
}
|
|
||||||
|
|
||||||
var key: PostboxViewKey {
|
|
||||||
return .cachedPeerData(peerId: self.id)
|
|
||||||
}
|
|
||||||
|
|
||||||
func extract(view: PostboxView) -> Result {
|
|
||||||
guard let view = view as? CachedPeerDataView else {
|
|
||||||
preconditionFailure()
|
|
||||||
}
|
|
||||||
if let cachedData = view.cachedPeerData as? CachedUserData {
|
|
||||||
return cachedData.birthday
|
|
||||||
} else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,12 +10,12 @@ public enum CachedStickerPackResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func cacheStickerPack(transaction: Transaction, info: StickerPackCollectionInfo, items: [StickerPackItem], reference: StickerPackReference? = nil) {
|
func cacheStickerPack(transaction: Transaction, info: StickerPackCollectionInfo, items: [StickerPackItem], reference: StickerPackReference? = nil) {
|
||||||
if let entry = CodableEntry(CachedStickerPack(info: info, items: items, hash: info.hash)) {
|
guard let entry = CodableEntry(CachedStickerPack(info: info, items: items, hash: info.hash)) else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
transaction.putItemCacheEntry(id: ItemCacheEntryId(collectionId: Namespaces.CachedItemCollection.cachedStickerPacks, key: CachedStickerPack.cacheKey(info.id)), entry: entry)
|
transaction.putItemCacheEntry(id: ItemCacheEntryId(collectionId: Namespaces.CachedItemCollection.cachedStickerPacks, key: CachedStickerPack.cacheKey(info.id)), entry: entry)
|
||||||
}
|
|
||||||
if let entry = CodableEntry(CachedStickerPack(info: info, items: items, hash: info.hash)) {
|
|
||||||
transaction.putItemCacheEntry(id: ItemCacheEntryId(collectionId: Namespaces.CachedItemCollection.cachedStickerPacks, key: CachedStickerPack.cacheKey(shortName: info.shortName.lowercased())), entry: entry)
|
transaction.putItemCacheEntry(id: ItemCacheEntryId(collectionId: Namespaces.CachedItemCollection.cachedStickerPacks, key: CachedStickerPack.cacheKey(shortName: info.shortName.lowercased())), entry: entry)
|
||||||
}
|
|
||||||
|
|
||||||
if let reference = reference {
|
if let reference = reference {
|
||||||
var namespace: Int32?
|
var namespace: Int32?
|
||||||
@ -57,11 +57,9 @@ func cacheStickerPack(transaction: Transaction, info: StickerPackCollectionInfo,
|
|||||||
id = info.id.id
|
id = info.id.id
|
||||||
}
|
}
|
||||||
if let namespace = namespace, let id = id {
|
if let namespace = namespace, let id = id {
|
||||||
if let entry = CodableEntry(CachedStickerPack(info: info, items: items, hash: info.hash)) {
|
|
||||||
transaction.putItemCacheEntry(id: ItemCacheEntryId(collectionId: Namespaces.CachedItemCollection.cachedStickerPacks, key: CachedStickerPack.cacheKey(ItemCollectionId(namespace: namespace, id: id))), entry: entry)
|
transaction.putItemCacheEntry(id: ItemCacheEntryId(collectionId: Namespaces.CachedItemCollection.cachedStickerPacks, key: CachedStickerPack.cacheKey(ItemCollectionId(namespace: namespace, id: id))), entry: entry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func _internal_cachedStickerPack(postbox: Postbox, network: Network, reference: StickerPackReference, forceRemote: Bool) -> Signal<CachedStickerPackResult, NoError> {
|
func _internal_cachedStickerPack(postbox: Postbox, network: Network, reference: StickerPackReference, forceRemote: Bool) -> Signal<CachedStickerPackResult, NoError> {
|
||||||
|
@ -270,6 +270,11 @@ func _internal_deleteStickerSet(account: Account, packReference: StickerPackRefe
|
|||||||
}
|
}
|
||||||
|> mapToSignal { _ in
|
|> mapToSignal { _ in
|
||||||
return account.postbox.transaction { transaction in
|
return account.postbox.transaction { transaction in
|
||||||
|
if let (info, _, _) = cachedStickerPack(transaction: transaction, reference: packReference) {
|
||||||
|
transaction.removeItemCacheEntry(id: ItemCacheEntryId(collectionId: Namespaces.CachedItemCollection.cachedStickerPacks, key: CachedStickerPack.cacheKey(info.id)))
|
||||||
|
transaction.removeItemCacheEntry(id: ItemCacheEntryId(collectionId: Namespaces.CachedItemCollection.cachedStickerPacks, key: CachedStickerPack.cacheKey(shortName: info.shortName.lowercased())))
|
||||||
|
}
|
||||||
|
|
||||||
if case let .id(id, _) = packReference {
|
if case let .id(id, _) = packReference {
|
||||||
transaction.removeItemCollection(collectionId: ItemCollectionId(namespace: Namespaces.ItemCollection.CloudStickerPacks, id: id))
|
transaction.removeItemCollection(collectionId: ItemCollectionId(namespace: Namespaces.ItemCollection.CloudStickerPacks, id: id))
|
||||||
}
|
}
|
||||||
|
@ -1149,7 +1149,7 @@ public final class ChatEntityKeyboardInputNode: ChatInputNode {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
guard let file = item.itemFile else {
|
guard let file = item.itemFile else {
|
||||||
if groupId == AnyHashable("recent"), case .icon(.add) = item.content {
|
if case .icon(.add) = item.content {
|
||||||
interaction.openStickerEditor()
|
interaction.openStickerEditor()
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -1828,6 +1828,7 @@ public extension EmojiPagerContentComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var addedCreateStickerButton = false
|
||||||
if let recentStickers = recentStickers {
|
if let recentStickers = recentStickers {
|
||||||
let groupId = "recent"
|
let groupId = "recent"
|
||||||
for item in recentStickers.items {
|
for item in recentStickers.items {
|
||||||
@ -1861,7 +1862,7 @@ public extension EmojiPagerContentComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !forceHasPremium, let groupIndex = itemGroupIndexById[groupId] {
|
if hasEdit && !addedCreateStickerButton, let groupIndex = itemGroupIndexById[groupId] {
|
||||||
let resultItem = EmojiPagerContentComponent.Item(
|
let resultItem = EmojiPagerContentComponent.Item(
|
||||||
animationData: nil,
|
animationData: nil,
|
||||||
content: .icon(.add),
|
content: .icon(.add),
|
||||||
@ -1871,6 +1872,7 @@ public extension EmojiPagerContentComponent {
|
|||||||
tintMode: .none
|
tintMode: .none
|
||||||
)
|
)
|
||||||
itemGroups[groupIndex].items.insert(resultItem, at: 0)
|
itemGroups[groupIndex].items.insert(resultItem, at: 0)
|
||||||
|
addedCreateStickerButton = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1879,6 +1881,7 @@ public extension EmojiPagerContentComponent {
|
|||||||
avatarPeer = peerSpecificPack.peer
|
avatarPeer = peerSpecificPack.peer
|
||||||
|
|
||||||
var processedIds = Set<MediaId>()
|
var processedIds = Set<MediaId>()
|
||||||
|
let groupId = "peerSpecific"
|
||||||
for item in peerSpecificPack.items {
|
for item in peerSpecificPack.items {
|
||||||
if isPremiumDisabled && item.file.isPremiumSticker {
|
if isPremiumDisabled && item.file.isPremiumSticker {
|
||||||
continue
|
continue
|
||||||
@ -1903,7 +1906,6 @@ public extension EmojiPagerContentComponent {
|
|||||||
tintMode: tintMode
|
tintMode: tintMode
|
||||||
)
|
)
|
||||||
|
|
||||||
let groupId = "peerSpecific"
|
|
||||||
if let groupIndex = itemGroupIndexById[groupId] {
|
if let groupIndex = itemGroupIndexById[groupId] {
|
||||||
itemGroups[groupIndex].items.append(resultItem)
|
itemGroups[groupIndex].items.append(resultItem)
|
||||||
} else {
|
} else {
|
||||||
@ -1911,6 +1913,19 @@ public extension EmojiPagerContentComponent {
|
|||||||
itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: peerSpecificPack.peer.compactDisplayTitle, subtitle: nil, actionButtonTitle: nil, isPremiumLocked: false, isFeatured: false, displayPremiumBadges: false, hasEdit: false, headerItem: nil, items: [resultItem]))
|
itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: peerSpecificPack.peer.compactDisplayTitle, subtitle: nil, actionButtonTitle: nil, isPremiumLocked: false, isFeatured: false, displayPremiumBadges: false, hasEdit: false, headerItem: nil, items: [resultItem]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if hasEdit && !addedCreateStickerButton, let groupIndex = itemGroupIndexById[groupId] {
|
||||||
|
let resultItem = EmojiPagerContentComponent.Item(
|
||||||
|
animationData: nil,
|
||||||
|
content: .icon(.add),
|
||||||
|
itemFile: nil,
|
||||||
|
subgroupId: nil,
|
||||||
|
icon: .none,
|
||||||
|
tintMode: .none
|
||||||
|
)
|
||||||
|
itemGroups[groupIndex].items.insert(resultItem, at: 0)
|
||||||
|
addedCreateStickerButton = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for entry in view.entries {
|
for entry in view.entries {
|
||||||
@ -1971,6 +1986,19 @@ public extension EmojiPagerContentComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: title, subtitle: nil, actionButtonTitle: nil, isPremiumLocked: false, isFeatured: false, displayPremiumBadges: true, hasEdit: hasEdit && groupHasEdit, headerItem: headerItem, items: [resultItem]))
|
itemGroups.append(ItemGroup(supergroupId: groupId, id: groupId, title: title, subtitle: nil, actionButtonTitle: nil, isPremiumLocked: false, isFeatured: false, displayPremiumBadges: true, hasEdit: hasEdit && groupHasEdit, headerItem: headerItem, items: [resultItem]))
|
||||||
|
|
||||||
|
if hasEdit && !addedCreateStickerButton, let groupIndex = itemGroupIndexById[groupId] {
|
||||||
|
let resultItem = EmojiPagerContentComponent.Item(
|
||||||
|
animationData: nil,
|
||||||
|
content: .icon(.add),
|
||||||
|
itemFile: nil,
|
||||||
|
subgroupId: nil,
|
||||||
|
icon: .none,
|
||||||
|
tintMode: .none
|
||||||
|
)
|
||||||
|
itemGroups[groupIndex].items.insert(resultItem, at: 0)
|
||||||
|
addedCreateStickerButton = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ private class TextField: UITextField, UIScrollViewDelegate {
|
|||||||
override func deleteBackward() {
|
override func deleteBackward() {
|
||||||
super.deleteBackward()
|
super.deleteBackward()
|
||||||
|
|
||||||
if let scrollView = self.scrollView {
|
if let scrollView = self.scrollView, self.fixEditingRect {
|
||||||
if scrollView.contentSize.width <= scrollView.frame.width && scrollView.contentOffset.x > -scrollView.contentInset.left {
|
if scrollView.contentSize.width <= scrollView.frame.width && scrollView.contentOffset.x > -scrollView.contentInset.left {
|
||||||
scrollView.contentOffset = CGPoint(x: max(scrollView.contentOffset.x - 5.0, -scrollView.contentInset.left), y: 0.0)
|
scrollView.contentOffset = CGPoint(x: max(scrollView.contentOffset.x - 5.0, -scrollView.contentInset.left), y: 0.0)
|
||||||
self.updatePrefixPosition()
|
self.updatePrefixPosition()
|
||||||
@ -116,6 +116,9 @@ private class TextField: UITextField, UIScrollViewDelegate {
|
|||||||
|
|
||||||
var fixAutoScroll: CGPoint?
|
var fixAutoScroll: CGPoint?
|
||||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||||
|
guard self.fixEditingRect else {
|
||||||
|
return
|
||||||
|
}
|
||||||
if let fixAutoScroll = self.fixAutoScroll {
|
if let fixAutoScroll = self.fixAutoScroll {
|
||||||
self.scrollView?.setContentOffset(fixAutoScroll, animated: true)
|
self.scrollView?.setContentOffset(fixAutoScroll, animated: true)
|
||||||
self.scrollView?.setContentOffset(fixAutoScroll, animated: false)
|
self.scrollView?.setContentOffset(fixAutoScroll, animated: false)
|
||||||
@ -161,6 +164,7 @@ private class TextField: UITextField, UIScrollViewDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override func textRect(forBounds bounds: CGRect) -> CGRect {
|
override func textRect(forBounds bounds: CGRect) -> CGRect {
|
||||||
|
if self.fixEditingRect {
|
||||||
if bounds.size.width.isZero {
|
if bounds.size.width.isZero {
|
||||||
return CGRect(origin: CGPoint(), size: CGSize())
|
return CGRect(origin: CGPoint(), size: CGSize())
|
||||||
}
|
}
|
||||||
@ -179,10 +183,18 @@ private class TextField: UITextField, UIScrollViewDelegate {
|
|||||||
}
|
}
|
||||||
rect.size.width = max(rect.size.width, 10.0)
|
rect.size.width = max(rect.size.width, 10.0)
|
||||||
return rect
|
return rect
|
||||||
|
} else {
|
||||||
|
return super.textRect(forBounds: bounds)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var fixEditingRect = false
|
||||||
override func editingRect(forBounds bounds: CGRect) -> CGRect {
|
override func editingRect(forBounds bounds: CGRect) -> CGRect {
|
||||||
|
if self.fixEditingRect {
|
||||||
return self.textRect(forBounds: bounds)
|
return self.textRect(forBounds: bounds)
|
||||||
|
} else {
|
||||||
|
return super.editingRect(forBounds: bounds)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func layoutSubviews() {
|
override func layoutSubviews() {
|
||||||
@ -196,13 +208,15 @@ private class TextField: UITextField, UIScrollViewDelegate {
|
|||||||
let textRect = self.textRect(forBounds: bounds)
|
let textRect = self.textRect(forBounds: bounds)
|
||||||
|
|
||||||
let labelSize = self.placeholderLabel.updateLayout(textRect.size)
|
let labelSize = self.placeholderLabel.updateLayout(textRect.size)
|
||||||
self.placeholderLabel.frame = CGRect(origin: CGPoint(x: textRect.minX + 3.0, y: floorToScreenPixels((bounds.height - labelSize.height) / 2.0)), size: labelSize)
|
self.placeholderLabel.frame = CGRect(origin: CGPoint(x: textRect.minX + (self.fixEditingRect ? 3.0 : 0.0), y: floorToScreenPixels((bounds.height - labelSize.height) / 2.0)), size: labelSize)
|
||||||
|
|
||||||
let prefixSize = self.prefixLabel.updateLayout(CGSize(width: floor(bounds.size.width * 0.7), height: bounds.size.height))
|
let prefixSize = self.prefixLabel.updateLayout(CGSize(width: floor(bounds.size.width * 0.7), height: bounds.size.height))
|
||||||
let prefixBounds = bounds.insetBy(dx: 4.0, dy: 4.0)
|
let prefixBounds = bounds.insetBy(dx: 4.0, dy: 4.0)
|
||||||
self.prefixLabel.frame = CGRect(origin: CGPoint(x: self.prefixPosition ?? prefixBounds.minX, y: floorToScreenPixels((bounds.height - prefixSize.height) / 2.0)), size: prefixSize)
|
self.prefixLabel.frame = CGRect(origin: CGPoint(x: self.prefixPosition ?? prefixBounds.minX, y: floorToScreenPixels((bounds.height - prefixSize.height) / 2.0)), size: prefixSize)
|
||||||
|
if self.fixEditingRect {
|
||||||
self.updatePrefixWidth(prefixSize.width + 3.0)
|
self.updatePrefixWidth(prefixSize.width + 3.0)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private let validIdentifierSet: CharacterSet = {
|
private let validIdentifierSet: CharacterSet = {
|
||||||
@ -276,6 +290,7 @@ private final class ImportStickerPackTitleInputFieldNode: ASDisplayNode, UITextF
|
|||||||
self.textInputNode.autocorrectionType = .default
|
self.textInputNode.autocorrectionType = .default
|
||||||
self.textInputNode.tintColor = theme.actionSheet.controlAccentColor
|
self.textInputNode.tintColor = theme.actionSheet.controlAccentColor
|
||||||
self.textInputNode.textColor = theme.actionSheet.inputTextColor
|
self.textInputNode.textColor = theme.actionSheet.inputTextColor
|
||||||
|
self.textInputNode.fixEditingRect = hasClearButton
|
||||||
|
|
||||||
self.clearButton = HighlightableButtonNode()
|
self.clearButton = HighlightableButtonNode()
|
||||||
self.clearButton.imageNode.displaysAsynchronously = false
|
self.clearButton.imageNode.displaysAsynchronously = false
|
||||||
@ -325,7 +340,7 @@ private final class ImportStickerPackTitleInputFieldNode: ASDisplayNode, UITextF
|
|||||||
let backgroundFrame = CGRect(origin: CGPoint(x: backgroundInsets.left, y: backgroundInsets.top), size: CGSize(width: width - backgroundInsets.left - backgroundInsets.right, height: panelHeight - backgroundInsets.top - backgroundInsets.bottom))
|
let backgroundFrame = CGRect(origin: CGPoint(x: backgroundInsets.left, y: backgroundInsets.top), size: CGSize(width: width - backgroundInsets.left - backgroundInsets.right, height: panelHeight - backgroundInsets.top - backgroundInsets.bottom))
|
||||||
transition.updateFrame(node: self.backgroundNode, frame: backgroundFrame)
|
transition.updateFrame(node: self.backgroundNode, frame: backgroundFrame)
|
||||||
|
|
||||||
transition.updateFrame(view: self.textInputNode, frame: CGRect(origin: CGPoint(x: backgroundFrame.minX + inputInsets.left, y: backgroundFrame.minY), size: CGSize(width: backgroundFrame.size.width - inputInsets.left - inputInsets.right - 22.0, height: backgroundFrame.size.height)))
|
transition.updateFrame(view: self.textInputNode, frame: CGRect(origin: CGPoint(x: backgroundFrame.minX + inputInsets.left, y: backgroundFrame.minY), size: CGSize(width: backgroundFrame.size.width - inputInsets.left - inputInsets.right - (self.clearButton.supernode != nil ? 22.0 : 0.0), height: backgroundFrame.size.height)))
|
||||||
|
|
||||||
if let image = self.clearButton.image(for: []) {
|
if let image = self.clearButton.image(for: []) {
|
||||||
transition.updateFrame(node: self.clearButton, frame: CGRect(origin: CGPoint(x: backgroundFrame.maxX - 8.0 - image.size.width, y: backgroundFrame.minY + floor((backgroundFrame.size.height - image.size.height) / 2.0)), size: image.size))
|
transition.updateFrame(node: self.clearButton, frame: CGRect(origin: CGPoint(x: backgroundFrame.maxX - 8.0 - image.size.width, y: backgroundFrame.minY + floor((backgroundFrame.size.height - image.size.height) / 2.0)), size: image.size))
|
||||||
|
@ -11781,7 +11781,15 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
}
|
}
|
||||||
switch action {
|
switch action {
|
||||||
case .info:
|
case .info:
|
||||||
let controller = context.sharedContext.makePremiumIntroController(context: self.context, source: .reactions, forceDark: false, dismissed: nil)
|
let context = self.context
|
||||||
|
var replaceImpl: ((ViewController) -> Void)?
|
||||||
|
let controller = context.sharedContext.makePremiumDemoController(context: context, subject: .fasterDownload, action: {
|
||||||
|
let controller = context.sharedContext.makePremiumIntroController(context: context, source: .fasterDownload, forceDark: false, dismissed: nil)
|
||||||
|
replaceImpl?(controller)
|
||||||
|
})
|
||||||
|
replaceImpl = { [weak controller] c in
|
||||||
|
controller?.replace(with: c)
|
||||||
|
}
|
||||||
self.push(controller)
|
self.push(controller)
|
||||||
return true
|
return true
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user