diff --git a/submodules/TabBarUI/Sources/TabBarContollerNode.swift b/submodules/TabBarUI/Sources/TabBarContollerNode.swift index 80e3f31041..d19d408b86 100644 --- a/submodules/TabBarUI/Sources/TabBarContollerNode.swift +++ b/submodules/TabBarUI/Sources/TabBarContollerNode.swift @@ -12,6 +12,7 @@ private extension ToolbarTheme { final class TabBarControllerNode: ASDisplayNode { private var navigationBarPresentationData: NavigationBarPresentationData + private let showTabNames: Bool // MARK: Swiftgram private var theme: TabBarControllerTheme let tabBarNode: TabBarNode private let disabledOverlayNode: ASDisplayNode @@ -45,6 +46,7 @@ final class TabBarControllerNode: ASDisplayNode { init(showTabNames: Bool, theme: TabBarControllerTheme, navigationBarPresentationData: NavigationBarPresentationData, itemSelected: @escaping (Int, Bool, [ASDisplayNode]) -> Void, contextAction: @escaping (Int, ContextExtractedContentContainingNode, ContextGesture) -> Void, swipeAction: @escaping (Int, TabBarItemSwipeDirection) -> Void, toolbarActionSelected: @escaping (ToolbarActionOption) -> Void, disabledPressed: @escaping () -> Void) { self.theme = theme + self.showTabNames = showTabNames self.navigationBarPresentationData = navigationBarPresentationData self.tabBarNode = TabBarNode(showTabNames: showTabNames, theme: theme, itemSelected: itemSelected, contextAction: contextAction, swipeAction: swipeAction) self.tabBarNode.isHidden = SGSimpleSettings.shared.hideTabBar @@ -103,8 +105,10 @@ final class TabBarControllerNode: ASDisplayNode { let bottomInset: CGFloat = layout.insets(options: options).bottom if !layout.safeInsets.left.isZero { tabBarHeight = 34.0 + bottomInset + if !self.showTabNames { tabBarHeight -= 6.0 } // MARK: Swiftgram } else { tabBarHeight = 49.0 + bottomInset + if !self.showTabNames { tabBarHeight -= 12.0 } // MARK: Swiftgram } let tabBarFrame = CGRect(origin: CGPoint(x: 0.0, y: layout.size.height - (self.tabBarHidden ? 0.0 : tabBarHeight)), size: CGSize(width: layout.size.width, height: tabBarHeight)) diff --git a/submodules/TabBarUI/Sources/TabBarController.swift b/submodules/TabBarUI/Sources/TabBarController.swift index e529ef8b41..9105974450 100644 --- a/submodules/TabBarUI/Sources/TabBarController.swift +++ b/submodules/TabBarUI/Sources/TabBarController.swift @@ -272,6 +272,7 @@ open class TabBarControllerImpl: ViewController, TabBarController { } else { tabBarHeight = 49.0 + bottomInset } + if !strongSelf.showTabNames { tabBarHeight -= 12.0 } // MARK: Swiftgram updatedLayout.intrinsicInsets.bottom = tabBarHeight strongSelf.controllers[index].containerLayoutUpdated(updatedLayout, transition: .immediate) @@ -448,8 +449,10 @@ open class TabBarControllerImpl: ViewController, TabBarController { let bottomInset: CGFloat = updatedLayout.insets(options: options).bottom if !updatedLayout.safeInsets.left.isZero { tabBarHeight = 34.0 + bottomInset + if !self.showTabNames { tabBarHeight -= 6.0 } // MARK: Swiftgram } else { tabBarHeight = 49.0 + bottomInset + if !self.showTabNames { tabBarHeight -= 12.0 } // MARK: Swiftgram } if !self.tabBarControllerNode.tabBarHidden { updatedLayout.intrinsicInsets.bottom = tabBarHeight @@ -477,8 +480,10 @@ open class TabBarControllerImpl: ViewController, TabBarController { let bottomInset: CGFloat = updatedLayout.insets(options: options).bottom if !updatedLayout.safeInsets.left.isZero { tabBarHeight = 34.0 + bottomInset + if !self.showTabNames { tabBarHeight -= 6.0 } // MARK: Swiftgram } else { tabBarHeight = 49.0 + bottomInset + if !self.showTabNames { tabBarHeight -= 12.0 } // MARK: Swiftgram } if !self.tabBarControllerNode.tabBarHidden { updatedLayout.intrinsicInsets.bottom = tabBarHeight