Attachment menu improvements

This commit is contained in:
Ilya Laktyushin
2022-02-21 10:11:53 +03:00
parent 2efbb9170f
commit d811f5f160
80 changed files with 6104 additions and 1273 deletions

View File

@@ -16,13 +16,15 @@ final class WebSearchNavigationContentNode: NavigationBarContentNode {
private var queryUpdated: ((String) -> Void)?
init(theme: PresentationTheme, strings: PresentationStrings) {
var cancel: (() -> Void)?
init(theme: PresentationTheme, strings: PresentationStrings, attachment: Bool) {
self.theme = theme
self.strings = strings
self.searchBar = SearchBarNode(theme: SearchBarNodeTheme(theme: theme, hasSeparator: false), strings: strings, fieldStyle: .modern)
self.searchBar.hasCancelButton = false
self.searchBar.placeholderString = NSAttributedString(string: strings.Common_Search, font: searchBarFont, textColor: theme.rootController.navigationSearchBar.inputPlaceholderTextColor)
self.searchBar.hasCancelButton = attachment
self.searchBar.placeholderString = NSAttributedString(string: attachment ? strings.Attachment_SearchWeb : strings.Common_Search, font: searchBarFont, textColor: theme.rootController.navigationSearchBar.inputPlaceholderTextColor)
super.init()
@@ -36,6 +38,9 @@ final class WebSearchNavigationContentNode: NavigationBarContentNode {
self?.queryUpdated?(query)
}
}
self.searchBar.cancel = { [weak self] in
self?.cancel?()
}
}
func setQueryUpdated(_ f: @escaping (String) -> Void) {