mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Smaller tabbar if names are hidden, closes #115
This commit is contained in:
parent
15dbdd4fe5
commit
216ab09b20
@ -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
|
||||
@ -106,6 +108,7 @@ final class TabBarControllerNode: ASDisplayNode {
|
||||
} 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))
|
||||
|
||||
|
@ -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)
|
||||
@ -451,6 +452,7 @@ open class TabBarControllerImpl: ViewController, TabBarController {
|
||||
} else {
|
||||
tabBarHeight = 49.0 + bottomInset
|
||||
}
|
||||
if !self.showTabNames { tabBarHeight -= 12.0 } // MARK: Swiftgram
|
||||
if !self.tabBarControllerNode.tabBarHidden {
|
||||
updatedLayout.intrinsicInsets.bottom = tabBarHeight
|
||||
}
|
||||
@ -480,6 +482,7 @@ open class TabBarControllerImpl: ViewController, TabBarController {
|
||||
} else {
|
||||
tabBarHeight = 49.0 + bottomInset
|
||||
}
|
||||
if !self.showTabNames { tabBarHeight -= 12.0 } // MARK: Swiftgram
|
||||
if !self.tabBarControllerNode.tabBarHidden {
|
||||
updatedLayout.intrinsicInsets.bottom = tabBarHeight
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user