diff --git a/submodules/ChatListUI/Sources/ChatListControllerNode.swift b/submodules/ChatListUI/Sources/ChatListControllerNode.swift index cc49fa3346..9847039dc6 100644 --- a/submodules/ChatListUI/Sources/ChatListControllerNode.swift +++ b/submodules/ChatListUI/Sources/ChatListControllerNode.swift @@ -1574,7 +1574,8 @@ final class ChatListControllerNode: ASDisplayNode, ASGestureRecognizerDelegate { ) }, selectedTab: selectedTab, - isEditing: isEditing + isEditing: isEditing, + liftWhileSwitching: layout.deviceMetrics.type != .tablet )) } diff --git a/submodules/TelegramUI/Components/HorizontalTabsComponent/Sources/HorizontalTabsComponent.swift b/submodules/TelegramUI/Components/HorizontalTabsComponent/Sources/HorizontalTabsComponent.swift index 302af7964d..7e40c4a4e9 100644 --- a/submodules/TelegramUI/Components/HorizontalTabsComponent/Sources/HorizontalTabsComponent.swift +++ b/submodules/TelegramUI/Components/HorizontalTabsComponent/Sources/HorizontalTabsComponent.swift @@ -223,6 +223,7 @@ public final class HorizontalTabsComponent: Component { public let selectedTab: Tab.Id? public let isEditing: Bool public let layout: Layout + public let liftWhileSwitching: Bool public init( context: AccountContext?, @@ -230,7 +231,8 @@ public final class HorizontalTabsComponent: Component { tabs: [Tab], selectedTab: Tab.Id?, isEditing: Bool, - layout: Layout = .fill + layout: Layout = .fill, + liftWhileSwitching: Bool = true ) { self.context = context self.theme = theme @@ -238,6 +240,7 @@ public final class HorizontalTabsComponent: Component { self.selectedTab = selectedTab self.isEditing = isEditing self.layout = layout + self.liftWhileSwitching = liftWhileSwitching } public static func ==(lhs: HorizontalTabsComponent, rhs: HorizontalTabsComponent) -> Bool { @@ -256,6 +259,9 @@ public final class HorizontalTabsComponent: Component { if lhs.layout != rhs.layout { return false } + if lhs.liftWhileSwitching != rhs.liftWhileSwitching { + return false + } return true } @@ -568,7 +574,7 @@ public final class HorizontalTabsComponent: Component { return } var isLifted = self.temporaryLiftTimer != nil - if component.theme.overallDarkAppearance { + if !component.liftWhileSwitching { isLifted = false } self.lensView.update(size: CGSize(width: layoutData.size.width - 3.0 * 2.0, height: layoutData.size.height - 3.0 * 2.0), selectionOrigin: CGPoint(x: -self.scrollView.contentOffset.x + layoutData.selectedItemFrame.minX, y: 0.0), selectionSize: CGSize(width: layoutData.selectedItemFrame.width, height: layoutData.size.height - 3.0 * 2.0), inset: 0.0, liftedInset: 6.0, isDark: component.theme.overallDarkAppearance, isLifted: isLifted, transition: transition) diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoChatListPaneNode/Sources/PeerInfoChatListPaneNode.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoChatListPaneNode/Sources/PeerInfoChatListPaneNode.swift index ec78d27165..56432727d9 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoChatListPaneNode/Sources/PeerInfoChatListPaneNode.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoChatListPaneNode/Sources/PeerInfoChatListPaneNode.swift @@ -58,11 +58,11 @@ private final class SearchNavigationContentNode: ASDisplayNode, PeerInfoPanelNod func update(width: CGFloat, defaultHeight: CGFloat, insets: UIEdgeInsets, transition: ContainedViewLayoutTransition) -> CGFloat { self.params = Params(width: width, defaultHeight: defaultHeight, insets: insets) - let size = CGSize(width: width, height: defaultHeight) - transition.updateFrame(node: self.contentNode, frame: CGRect(origin: CGPoint(x: 0.0, y: 10.0), size: size)) + let size = CGSize(width: width, height: 60.0) + transition.updateFrame(node: self.contentNode, frame: CGRect(origin: CGPoint(x: 0.0, y: -6.0), size: size)) let _ = self.contentNode.updateLayout(size: size, leftInset: insets.left, rightInset: insets.right, transition: transition) - var contentHeight: CGFloat = size.height + 10.0 + var contentHeight: CGFloat = size.height if self.appliedPanelNode !== self.panelNode { if let previous = self.appliedPanelNode { @@ -81,7 +81,8 @@ private final class SearchNavigationContentNode: ASDisplayNode, PeerInfoPanelNod panelNode.alpha = 0.0 transition.updateAlpha(node: panelNode, alpha: 1.0) - contentHeight += panelHeight - 1.0 + contentHeight += 80.0 + contentHeight += panelHeight } } else if let panelNode = self.panelNode, let chatController = self.chatController { let panelLayout = panelNode.updateLayout(width: width, leftInset: insets.left, rightInset: insets.right, transition: transition, chatController: chatController) @@ -89,7 +90,8 @@ private final class SearchNavigationContentNode: ASDisplayNode, PeerInfoPanelNod let panelFrame = CGRect(origin: CGPoint(x: 0.0, y: contentHeight), size: CGSize(width: width, height: panelHeight)) transition.updateFrame(node: panelNode, frame: panelFrame) - contentHeight += panelHeight - 1.0 + contentHeight += 80.0 + contentHeight += panelHeight } return contentHeight diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoPaneContainerNode.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoPaneContainerNode.swift index d7f066a4f4..0c77015eb4 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoPaneContainerNode.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoPaneContainerNode.swift @@ -1341,7 +1341,8 @@ final class PeerInfoPaneContainerNode: ASDisplayNode, ASGestureRecognizerDelegat }, selectedTab: self.currentPaneKey.flatMap { HorizontalTabsComponent.Tab.Id($0) }, isEditing: false, - layout: .fit + layout: .fit, + liftWhileSwitching: deviceMetrics.type != .tablet )), environment: {}, containerSize: tabsContainerSize diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift index f86af1c682..0033716566 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift @@ -12755,7 +12755,9 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro restoreContentOffset = self.scrollNode.view.contentOffset } - contentHeight -= 18.0 + if !self.isMediaOnly { + contentHeight -= 18.0 + } let paneContainerFrame = CGRect(origin: CGPoint(x: 0.0, y: contentHeight), size: paneContainerSize) if self.state.isEditing || (self.data?.availablePanes ?? []).isEmpty { transition.updateAlpha(node: self.paneContainerNode, alpha: 0.0)