mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-30 07:50:03 +00:00
Fixed accessory panels and section headers inset from navigation bar
This commit is contained in:
@@ -107,6 +107,14 @@ open class TabBarController: ViewController {
|
||||
|
||||
var currentController: ViewController?
|
||||
|
||||
open override var navigationBarRequiresEntireLayoutUpdate: Bool {
|
||||
if let currentController = currentController {
|
||||
return currentController.navigationBarRequiresEntireLayoutUpdate
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
private let pendingControllerDisposable = MetaDisposable()
|
||||
|
||||
private var theme: TabBarControllerTheme
|
||||
|
||||
@@ -140,6 +140,9 @@ open class ViewControllerPresentationArguments {
|
||||
private var previewingContext: Any?
|
||||
|
||||
public var displayNavigationBar = true
|
||||
open var navigationBarRequiresEntireLayoutUpdate: Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
private weak var activeInputViewCandidate: UIResponder?
|
||||
private weak var activeInputView: UIResponder?
|
||||
@@ -258,7 +261,11 @@ open class ViewControllerPresentationArguments {
|
||||
}
|
||||
self.navigationBar?.requestContainerLayout = { [weak self] transition in
|
||||
if let strongSelf = self, strongSelf.isNodeLoaded, let validLayout = strongSelf.validLayout {
|
||||
strongSelf.updateNavigationBarLayout(validLayout, transition: transition)
|
||||
if strongSelf.navigationBarRequiresEntireLayoutUpdate {
|
||||
strongSelf.containerLayoutUpdated(validLayout, transition: transition)
|
||||
} else {
|
||||
strongSelf.updateNavigationBarLayout(validLayout, transition: transition)
|
||||
}
|
||||
}
|
||||
}
|
||||
self.navigationBar?.item = self.navigationItem
|
||||
|
||||
@@ -544,6 +544,10 @@ private final class SettingsControllerImpl: ItemListController<SettingsEntry>, S
|
||||
|
||||
weak var switchController: TabBarAccountSwitchController?
|
||||
|
||||
override var navigationBarRequiresEntireLayoutUpdate: Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
init(currentContext: AccountContext, contextValue: Promise<AccountContext>, state: Signal<(ItemListControllerState, (ItemListNodeState<SettingsEntry>, SettingsEntry.ItemGenerationArguments)), NoError>, tabBarItem: Signal<ItemListControllerTabBarItem, NoError>?, accountsAndPeers: Signal<((Account, Peer)?, [(Account, Peer, Int32)]), NoError>) {
|
||||
self.sharedContext = currentContext.sharedContext
|
||||
self.contextValue = contextValue
|
||||
@@ -1435,7 +1439,7 @@ public func settingsController(context: AccountContext, accountManager: AccountM
|
||||
return state
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
setDisplayNavigationBarImpl = { [weak controller] display in
|
||||
controller?.setDisplayNavigationBar(display, transition: .animated(duration: 0.5, curve: .spring))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user