Gallery fixes

This commit is contained in:
Isaac 2026-02-13 18:09:56 +04:00
parent ddf5ac7275
commit fe8d847408
3 changed files with 7 additions and 4 deletions

View file

@ -74,6 +74,7 @@ swift_library(
"//submodules/TelegramUI/Components/GlassBackgroundComponent",
"//submodules/TelegramUI/Components/GlassControls",
"//submodules/TelegramUI/Components/VideoPlaybackControlsComponent",
"//submodules/UIKitRuntimeUtils",
],
visibility = [
"//visibility:public",

View file

@ -37,6 +37,7 @@ import ComponentDisplayAdapters
import EdgeEffect
import RasterizedCompositionComponent
import BadgeComponent
import UIKitRuntimeUtils
private let deleteImage = generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Accessory Panels/MessageSelectionTrash"), color: .white)
private let actionImage = generateTintedImage(image: UIImage(bundleImageName: "Chat/Input/Accessory Panels/MessageSelectionForward"), color: .white)
@ -2217,7 +2218,7 @@ final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, ASScroll
}
}
func setFramePreviewImage(image: UIImage?) {
func setFramePreviewImage(image: UIImage?, isSecret: Bool) {
if let image = image {
let videoFramePreviewNode: ASImageNode
let videoFrameTextNode: ImmediateTextNode
@ -2254,6 +2255,7 @@ final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, ASScroll
videoFramePreviewNode.subnodes?.first?.alpha = 0.0
let updateLayout = videoFramePreviewNode.image?.size != image.size
videoFramePreviewNode.image = image
setLayerDisableScreenshots(videoFramePreviewNode.layer, isSecret)
if updateLayout, let validLayout = self.validLayout {
let _ = self.updateLayout(size: validLayout.0, metrics: validLayout.1, leftInset: validLayout.2, rightInset: validLayout.3, bottomInset: validLayout.4, contentInset: validLayout.5, transition: .immediate)
}

View file

@ -1085,15 +1085,15 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
guard let strongSelf = self else {
return
}
if let result = result, strongSelf.scrubbingFrames {
if let result = result, strongSelf.scrubbingFrames, let item = strongSelf.item {
switch result {
case .waitingForData:
strongSelf.footerContentNode.setFramePreviewImageIsLoading()
case let .image(image):
strongSelf.footerContentNode.setFramePreviewImage(image: image)
strongSelf.footerContentNode.setFramePreviewImage(image: image, isSecret: item.isSecret)
}
} else {
strongSelf.footerContentNode.setFramePreviewImage(image: nil)
strongSelf.footerContentNode.setFramePreviewImage(image: nil, isSecret: false)
}
}).strict()