Various improvements

This commit is contained in:
Ilya Laktyushin
2024-03-25 20:43:34 +04:00
parent b7c18980f6
commit 24d7deb3e8
43 changed files with 2076 additions and 1055 deletions

View File

@@ -2191,11 +2191,11 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable {
}
@objc private func searchOrMorePressed(node: ContextReferenceContentNode, gesture: ContextGesture?) {
//TODO:localize
if case let .assets(_, mode) = self.subject, [.story, .addImage, .createSticker].contains(mode) {
let strings = self.presentationData.strings
if case let .assets(_, mode) = self.subject, [.createSticker].contains(mode) {
var items: [ContextMenuItem] = []
if mode != .addImage {
items.append(.action(ContextMenuActionItem(text: "Create", icon: { theme in
items.append(.action(ContextMenuActionItem(text: strings.Attachment_Create, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Draw"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] _, f in
f(.default)
@@ -2204,7 +2204,7 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable {
})))
}
items.append(.action(ContextMenuActionItem(text: "Select from Files", icon: { theme in
items.append(.action(ContextMenuActionItem(text: strings.Attachment_SelectFromFiles, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/File"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] _, f in
f(.default)
@@ -2223,7 +2223,6 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable {
// self.presentSearch(activateOnDisplay: true)
break
case .more:
let strings = self.presentationData.strings
let selectionCount = self.selectionCount
var isSpoilerAvailable = true