Chat wallpaper fixes

This commit is contained in:
Ilya Laktyushin 2023-04-12 21:09:24 +04:00
parent 32251e1ef2
commit e64d88916d
7 changed files with 27 additions and 4 deletions

View File

@ -9318,3 +9318,8 @@ Sorry for the inconvenience.";
"FolderLinkPreview.ListSelectionSelectAllStaticPartSelect" = "ALL"; "FolderLinkPreview.ListSelectionSelectAllStaticPartSelect" = "ALL";
"FolderLinkPreview.ListSelectionSelectAllStaticPartDeselect" = "ALL"; "FolderLinkPreview.ListSelectionSelectAllStaticPartDeselect" = "ALL";
"FolderLinkPreview.ListSelectionSelectAllFormat" = "{dynamic}{static}"; "FolderLinkPreview.ListSelectionSelectAllFormat" = "{dynamic}{static}";
"UserInfo.ChangeWallpaper" = "Change Wallpaper";
"Conversation.Theme.PreviewDarkShort" = "Tap to view this theme in the night mode.";
"Conversation.Theme.PreviewLightShort" = "Tap to view this theme in the day mode.";

View File

@ -451,6 +451,7 @@ private final class MainButtonNode: HighlightTrackingButtonNode {
super.init(pointerStyle: pointerStyle) super.init(pointerStyle: pointerStyle)
self.isExclusiveTouch = true
self.clipsToBounds = true self.clipsToBounds = true
self.addSubnode(self.backgroundAnimationNode) self.addSubnode(self.backgroundAnimationNode)

View File

@ -515,8 +515,11 @@ public class WallpaperGalleryController: ViewController {
var dismissed = false var dismissed = false
toolbarNode.done = { [weak self] in toolbarNode.done = { [weak self] in
if let strongSelf = self, !dismissed { if let strongSelf = self, !dismissed {
dismissed = true
if let centralItemNode = strongSelf.galleryNode.pager.centralItemNode() as? WallpaperGalleryItemNode { if let centralItemNode = strongSelf.galleryNode.pager.centralItemNode() as? WallpaperGalleryItemNode {
if centralItemNode.cropNode.scrollNode.view.isDecelerating {
return
}
dismissed = true
let options = centralItemNode.options let options = centralItemNode.options
if !strongSelf.entries.isEmpty { if !strongSelf.entries.isEmpty {
let entry = strongSelf.entries[centralItemNode.index] let entry = strongSelf.entries[centralItemNode.index]

View File

@ -88,6 +88,8 @@ final class WallpaperGalleryToolbarNode: ASDisplayNode {
super.init() super.init()
self.doneButton.isExclusiveTouch = true
self.addSubnode(self.doneButtonBackgroundNode) self.addSubnode(self.doneButtonBackgroundNode)
self.addSubnode(self.doneButtonTitleNode) self.addSubnode(self.doneButtonTitleNode)

View File

@ -170,6 +170,8 @@ final class WallpaperNavigationButtonNode: HighlightTrackingButtonNode {
super.init() super.init()
self.isExclusiveTouch = true
self.addSubnode(self.backgroundNode) self.addSubnode(self.backgroundNode)
self.addSubnode(self.iconNode) self.addSubnode(self.iconNode)
self.addSubnode(self.textNode) self.addSubnode(self.textNode)
@ -320,6 +322,7 @@ final class WallpaperOptionButtonNode: HighlightTrackingButtonNode {
self.clipsToBounds = true self.clipsToBounds = true
self.cornerRadius = 14.0 self.cornerRadius = 14.0
self.isExclusiveTouch = true
switch value { switch value {
case let .check(selected): case let .check(selected):

View File

@ -314,8 +314,17 @@ final class ChatMessageNotificationItemNode: NotificationItemNode {
title = "📅 \(currentTitle)" title = "📅 \(currentTitle)"
} }
if let attribute = item.messages.first?.attributes.first(where: { $0 is NotificationInfoMessageAttribute }) as? NotificationInfoMessageAttribute, attribute.flags.contains(.muted), let currentTitle = title { if let message, item.messages.first, let attribute = message.attributes.first(where: { $0 is NotificationInfoMessageAttribute }) as? NotificationInfoMessageAttribute, attribute.flags.contains(.muted), let currentTitle = title {
title = "\(currentTitle) 🔕" var isAction = false
for media in message.media {
if media is TelegramMediaAction {
isAction = true
break
}
}
if !isAction {
title = "\(currentTitle) 🔕"
}
} }
let textFont = compact ? Font.regular(15.0) : Font.regular(16.0) let textFont = compact ? Font.regular(15.0) : Font.regular(16.0)

View File

@ -1261,7 +1261,7 @@ private class ChatThemeScreenNode: ViewControllerTracingNode, UIScrollViewDelega
if let strongSelf = self, count < 2 && currentTimestamp > timestamp + 24 * 60 * 60 { if let strongSelf = self, count < 2 && currentTimestamp > timestamp + 24 * 60 * 60 {
strongSelf.displayedPreviewTooltip = true strongSelf.displayedPreviewTooltip = true
strongSelf.present?(TooltipScreen(account: strongSelf.context.account, sharedContext: strongSelf.context.sharedContext, text: isDark ? strongSelf.presentationData.strings.Conversation_Theme_PreviewLight(strongSelf.peerName).string : strongSelf.presentationData.strings.Conversation_Theme_PreviewDark(strongSelf.peerName).string, style: .default, icon: nil, location: .point(frame.offsetBy(dx: 3.0, dy: 6.0), .bottom), displayDuration: .custom(3.0), inset: 3.0, shouldDismissOnTouch: { _ in strongSelf.present?(TooltipScreen(account: strongSelf.context.account, sharedContext: strongSelf.context.sharedContext, text: isDark ? strongSelf.presentationData.strings.Conversation_Theme_PreviewLightShort : strongSelf.presentationData.strings.Conversation_Theme_PreviewDarkShort, style: .default, icon: nil, location: .point(frame.offsetBy(dx: 3.0, dy: 6.0), .bottom), displayDuration: .custom(3.0), inset: 3.0, shouldDismissOnTouch: { _ in
return .dismiss(consume: false) return .dismiss(consume: false)
})) }))