Various fixes

This commit is contained in:
Ilya Laktyushin
2024-12-12 20:41:33 +04:00
parent 9e908c9ea7
commit ad9f0d6847
14 changed files with 214 additions and 31 deletions

View File

@@ -9,6 +9,7 @@ import ProgressNavigationButtonNode
import AccountContext
import SearchUI
import ChatListUI
import CounterControllerTitleView
public final class PeerSelectionControllerImpl: ViewController, PeerSelectionController {
private let context: AccountContext
@@ -64,6 +65,7 @@ public final class PeerSelectionControllerImpl: ViewController, PeerSelectionCon
private let forwardedMessageIds: [EngineMessage.Id]
private let hasTypeHeaders: Bool
private let requestPeerType: [ReplyMarkupButtonRequestPeerType]?
let multipleSelectionLimit: Int32?
private let hasCreation: Bool
let immediatelyActivateMultipleSelection: Bool
@@ -81,6 +83,7 @@ public final class PeerSelectionControllerImpl: ViewController, PeerSelectionCon
}
}
private(set) var titleView: CounterControllerTitleView?
private var searchContentNode: NavigationBarSearchContentNode?
var tabContainerNode: ChatListFilterTabContainerNode?
private var tabContainerData: ([ChatListFilterTabEntry], Bool, Int32?)?
@@ -107,6 +110,7 @@ public final class PeerSelectionControllerImpl: ViewController, PeerSelectionCon
self.requestPeerType = params.requestPeerType
self.hasCreation = params.hasCreation
self.immediatelyActivateMultipleSelection = params.immediatelyActivateMultipleSelection
self.multipleSelectionLimit = params.multipleSelectionLimit
super.init(navigationBarPresentationData: NavigationBarPresentationData(presentationData: self.presentationData))
@@ -133,7 +137,13 @@ public final class PeerSelectionControllerImpl: ViewController, PeerSelectionCon
}
}
self.title = self.customTitle ?? self.presentationData.strings.Conversation_ForwardTitle
if let maxCount = params.multipleSelectionLimit {
self.titleView = CounterControllerTitleView(theme: self.presentationData.theme)
self.titleView?.title = CounterControllerTitle(title: self.customTitle ?? self.presentationData.strings.Conversation_ForwardTitle, counter: "0/\(maxCount)")
self.navigationItem.titleView = self.titleView
} else {
self.title = self.customTitle ?? self.presentationData.strings.Conversation_ForwardTitle
}
if params.forumPeerId == nil {
self.navigationPresentation = .modal