mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Various fixes
This commit is contained in:
@@ -13,6 +13,7 @@ import BundleIconComponent
|
||||
import TelegramUIPreferences
|
||||
import OpenInExternalAppUI
|
||||
import MultilineTextComponent
|
||||
import MinimizedContainer
|
||||
|
||||
private let settingsTag = GenericComponentViewTag()
|
||||
|
||||
@@ -291,6 +292,7 @@ public class BrowserScreen: ViewController {
|
||||
guard let strongSelf = self else {
|
||||
return
|
||||
}
|
||||
strongSelf.controller?.title = state.title
|
||||
strongSelf.contentState = state
|
||||
strongSelf.requestLayout(transition: .immediate)
|
||||
}).strict()
|
||||
@@ -318,7 +320,7 @@ public class BrowserScreen: ViewController {
|
||||
}
|
||||
self.controller?.present(shareController, in: .window(.root))
|
||||
case .minimize:
|
||||
break
|
||||
self.minimize()
|
||||
case .openIn:
|
||||
self.context.sharedContext.applicationBindings.openUrl(url)
|
||||
case .openSettings:
|
||||
@@ -441,6 +443,23 @@ public class BrowserScreen: ViewController {
|
||||
self.requestLayout(transition: animated ? .easeInOut(duration: 0.2) : .immediate)
|
||||
}
|
||||
|
||||
func minimize() {
|
||||
guard let controller = self.controller, let navigationController = controller.navigationController as? NavigationController else {
|
||||
return
|
||||
}
|
||||
navigationController.minimizeViewController(controller, damping: nil, setupContainer: { [weak self] current in
|
||||
let minimizedContainer: MinimizedContainerImpl?
|
||||
if let current = current as? MinimizedContainerImpl {
|
||||
minimizedContainer = current
|
||||
} else if let context = self?.controller?.context {
|
||||
minimizedContainer = MinimizedContainerImpl(sharedContext: context.sharedContext)
|
||||
} else {
|
||||
minimizedContainer = nil
|
||||
}
|
||||
return minimizedContainer
|
||||
}, animated: true)
|
||||
}
|
||||
|
||||
func openSettings() {
|
||||
guard let referenceView = self.componentHost.findTaggedView(tag: settingsTag) as? ReferenceButtonComponent.View else {
|
||||
return
|
||||
@@ -535,7 +554,8 @@ public class BrowserScreen: ViewController {
|
||||
self.context.sharedContext.applicationBindings.openUrl(openInUrl)
|
||||
}
|
||||
action(.default)
|
||||
}))]
|
||||
}))
|
||||
]
|
||||
|
||||
let contextController = ContextController(presentationData: self.presentationData, source: source, items: .single(ContextController.Items(content: .list(items))))
|
||||
self.controller?.present(contextController, in: .window(.root))
|
||||
|
||||
Reference in New Issue
Block a user