mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-03-23 23:53:20 +00:00
Upgrade peek controller to modern context menu implementation
This commit is contained in:
@@ -17,7 +17,7 @@ swift_library(
|
||||
"//submodules/AccountContext:AccountContext",
|
||||
"//submodules/TelegramUIPreferences:TelegramUIPreferences",
|
||||
"//submodules/ShareController:ShareController",
|
||||
"//submodules/ItemListUI:ItemListUI",
|
||||
"//submodules/ItemListUI:ItemListUI",
|
||||
"//submodules/StickerResources:StickerResources",
|
||||
"//submodules/AlertUI:AlertUI",
|
||||
"//submodules/PresentationDataUtils:PresentationDataUtils",
|
||||
@@ -28,6 +28,7 @@ swift_library(
|
||||
"//submodules/TelegramAnimatedStickerNode:TelegramAnimatedStickerNode",
|
||||
"//submodules/ShimmerEffect:ShimmerEffect",
|
||||
"//submodules/UndoUI:UndoUI",
|
||||
"//submodules/ContextUI:ContextUI",
|
||||
],
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
|
||||
@@ -12,6 +12,7 @@ import MergeLists
|
||||
import ActivityIndicator
|
||||
import TextFormat
|
||||
import AccountContext
|
||||
import ContextUI
|
||||
|
||||
private struct StickerPackPreviewGridEntry: Comparable, Identifiable {
|
||||
let index: Int
|
||||
@@ -189,7 +190,7 @@ final class ImportStickerPackControllerNode: ViewControllerTracingNode, UIScroll
|
||||
return nil
|
||||
}, present: { [weak self] content, sourceNode in
|
||||
if let strongSelf = self {
|
||||
let controller = PeekController(theme: PeekControllerTheme(presentationTheme: strongSelf.presentationData.theme), content: content, sourceNode: {
|
||||
let controller = PeekController(presentationData: strongSelf.presentationData, content: content, sourceNode: {
|
||||
return sourceNode
|
||||
})
|
||||
controller.visibilityUpdated = { [weak self] visible in
|
||||
|
||||
@@ -9,13 +9,14 @@ import SwiftSignalKit
|
||||
import StickerResources
|
||||
import AnimatedStickerNode
|
||||
import TelegramAnimatedStickerNode
|
||||
import ContextUI
|
||||
|
||||
public final class StickerPreviewPeekContent: PeekControllerContent {
|
||||
let account: Account
|
||||
public let item: ImportStickerPack.Sticker
|
||||
let menu: [PeekControllerMenuItem]
|
||||
let menu: [ContextMenuItem]
|
||||
|
||||
public init(account: Account, item: ImportStickerPack.Sticker, menu: [PeekControllerMenuItem]) {
|
||||
public init(account: Account, item: ImportStickerPack.Sticker, menu: [ContextMenuItem]) {
|
||||
self.account = account
|
||||
self.item = item
|
||||
self.menu = menu
|
||||
@@ -25,11 +26,11 @@ public final class StickerPreviewPeekContent: PeekControllerContent {
|
||||
return .freeform
|
||||
}
|
||||
|
||||
public func menuActivation() -> PeerkControllerMenuActivation {
|
||||
public func menuActivation() -> PeerControllerMenuActivation {
|
||||
return .press
|
||||
}
|
||||
|
||||
public func menuItems() -> [PeekControllerMenuItem] {
|
||||
public func menuItems() -> [ContextMenuItem] {
|
||||
return self.menu
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user