diff --git a/submodules/ChatSendMessageActionUI/Sources/SendButton.swift b/submodules/ChatSendMessageActionUI/Sources/SendButton.swift index b8532fda6a..dda0b206c5 100644 --- a/submodules/ChatSendMessageActionUI/Sources/SendButton.swift +++ b/submodules/ChatSendMessageActionUI/Sources/SendButton.swift @@ -70,7 +70,12 @@ final class SendButton: HighlightTrackingButton { size: CGSize, transition: ComponentTransition ) { - let innerSize = CGSize(width: size.width - 3.0 * 2.0, height: size.height - 3.0 * 2.0) + let innerSize: CGSize + if size.height == 40.0 { + innerSize = CGSize(width: size.width - 3.0 * 2.0, height: size.height - 3.0 * 2.0) + } else { + innerSize = CGSize(width: isAnimatedIn ? 38.0 : size.width - 5.0 * 2.0, height: 33.0) + } let containerFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - innerSize.width) * 0.5), y: floorToScreenPixels((size.height - innerSize.height) * 0.5)), size: innerSize) transition.setFrame(view: self.containerView, frame: containerFrame) transition.setCornerRadius(layer: self.containerView.layer, cornerRadius: innerSize.height * 0.5) diff --git a/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift b/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift index a8de2505e9..d965e9d6af 100644 --- a/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift @@ -112,7 +112,7 @@ private func calculateTextFieldRealInsets(presentationInterfaceState: ChatPresen var right: CGFloat = 0.0 right += max(0.0, accessoryButtonsWidth - 14.0) if actionControlsWidth != 0.0 { - right += actionControlsWidth + right += actionControlsWidth - 14.0 } return UIEdgeInsets(top: 4.5 + top, left: 0.0, bottom: 5.5 + bottom, right: right) @@ -1876,7 +1876,7 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg var leftInset = leftInset - var textInputBackgroundWidthOffset: CGFloat = 0.0 + let textInputBackgroundWidthOffset: CGFloat = 0.0 var attachmentButtonX: CGFloat = hideOffset.x + leftInset + leftMenuInset + 8.0 if !displayMediaButton || mediaRecordingState != nil { attachmentButtonX = -48.0 @@ -2241,11 +2241,7 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg leftInset += leftMenuInset - var composeButtonsOffset: CGFloat = 0.0 - if self.extendedSearchLayout { - composeButtonsOffset = 40.0 - textInputBackgroundWidthOffset = 36.0 - } + let composeButtonsOffset: CGFloat = 0.0 self.updateCounterTextNode(transition: transition) @@ -2493,7 +2489,7 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg var nextButtonTopRight = CGPoint(x: textInputContainerBackgroundFrame.width - accessoryButtonInset - rightSlowModeInset - actionButtonsSize.width + (inputHasText ? 4.0 : (8.0 + 1.0)), y: textInputContainerBackgroundFrame.height - minimalInputHeight) if self.extendedSearchLayout { - nextButtonTopRight.x -= 26.0 + nextButtonTopRight.x += 8.0 + 1.0 } for (item, button) in self.accessoryItemButtons.reversed() { let buttonSize = CGSize(width: button.buttonWidth, height: minimalInputHeight) diff --git a/submodules/TelegramUI/Components/EntityKeyboard/Sources/GifPagerContentComponent.swift b/submodules/TelegramUI/Components/EntityKeyboard/Sources/GifPagerContentComponent.swift index 203f4da517..e21a915d81 100644 --- a/submodules/TelegramUI/Components/EntityKeyboard/Sources/GifPagerContentComponent.swift +++ b/submodules/TelegramUI/Components/EntityKeyboard/Sources/GifPagerContentComponent.swift @@ -463,6 +463,8 @@ public final class GifPagerContentComponent: Component { } } + private let clippingView: UIView + private let shimmerHostView: PortalSourceView private let standaloneShimmerEffect: StandaloneShimmerEffect @@ -487,6 +489,9 @@ public final class GifPagerContentComponent: Component { private var currentLoadMoreToken: String? override init(frame: CGRect) { + self.clippingView = UIView() + self.clippingView.clipsToBounds = true + self.shimmerHostView = PortalSourceView() self.standaloneShimmerEffect = StandaloneShimmerEffect() @@ -508,8 +513,10 @@ public final class GifPagerContentComponent: Component { super.init(frame: frame) + self.addSubview(self.clippingView) + self.shimmerHostView.alpha = 0.0 - self.addSubview(self.shimmerHostView) + self.clippingView.addSubview(self.shimmerHostView) self.scrollView.delaysContentTouches = false if #available(iOSApplicationExtension 11.0, iOS 11.0, *) { @@ -524,10 +531,10 @@ public final class GifPagerContentComponent: Component { self.scrollView.delegate = self self.scrollClippingView.addSubview(self.scrollView) - self.addSubview(self.scrollClippingView) + self.clippingView.addSubview(self.scrollClippingView) self.scrollView.addSubview(self.placeholdersContainerView) - self.addSubview(self.searchHeaderContainer) + self.clippingView.addSubview(self.searchHeaderContainer) self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.tapGesture(_:)))) @@ -873,6 +880,8 @@ public final class GifPagerContentComponent: Component { externalTintMaskContainer.addSubview(self.mirrorSearchHeaderContainer) } } + + transition.setFrame(view: self.clippingView, frame: CGRect(origin: CGPoint(), size: CGSize(width: backgroundFrame.width, height: max(0.0, backgroundFrame.height - bottomPanelHeight)))) } func update(component: GifPagerContentComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment, transition: ComponentTransition) -> CGSize { diff --git a/submodules/TelegramUI/Components/GlassBackgroundComponent/Sources/GlassBackgroundComponent.swift b/submodules/TelegramUI/Components/GlassBackgroundComponent/Sources/GlassBackgroundComponent.swift index 1410cd9da9..cece4d6d93 100644 --- a/submodules/TelegramUI/Components/GlassBackgroundComponent/Sources/GlassBackgroundComponent.swift +++ b/submodules/TelegramUI/Components/GlassBackgroundComponent/Sources/GlassBackgroundComponent.swift @@ -738,12 +738,12 @@ public extension GlassBackgroundView { addShadow(context, false, CGPoint(x: 0.64, y: 0.64), 0.8, 0.0, UIColor(white: 1.0, alpha: edgeAlpha), .normal) } } else if b >= 0.2 { - let edgeAlpha: CGFloat = max(0.2, min(isDark ? 0.7 : 0.7, a * a * a)) + let edgeAlpha: CGFloat = max(0.2, min(isDark ? 0.5 : 0.7, a * a * a)) addShadow(context, false, CGPoint(x: -0.64, y: -0.64), 0.5, 0.0, UIColor(white: 1.0, alpha: edgeAlpha), .plusLighter) addShadow(context, false, CGPoint(x: 0.64, y: 0.64), 0.5, 0.0, UIColor(white: 1.0, alpha: edgeAlpha), .plusLighter) } else { - let edgeAlpha: CGFloat = max(0.4, min(1.0, a * a * a)) + let edgeAlpha: CGFloat = max(0.4, min(isDark ? 0.5 : 0.7, a * a * a)) addShadow(context, false, CGPoint(x: -0.64, y: -0.64), 1.2, 0.0, UIColor(white: 1.0, alpha: edgeAlpha), .normal) addShadow(context, false, CGPoint(x: 0.64, y: 0.64), 1.2, 0.0, UIColor(white: 1.0, alpha: edgeAlpha), .normal) diff --git a/submodules/TelegramUI/Sources/ChatControllerNode.swift b/submodules/TelegramUI/Sources/ChatControllerNode.swift index 1419fdcd8d..89a02bb4b3 100644 --- a/submodules/TelegramUI/Sources/ChatControllerNode.swift +++ b/submodules/TelegramUI/Sources/ChatControllerNode.swift @@ -2145,8 +2145,8 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate { if case let .media(_, expanded, _) = self.chatPresentationInterfaceState.inputMode, expanded != nil { additionalOffset = 80.0 } - if let inputPanelSize = inputPanelSize { - inputPanelHideOffset += -inputPanelSize.height - additionalOffset + if let _ = inputPanelSize { + inputPanelHideOffset += -40.0 - additionalOffset } if let accessoryPanelSize = accessoryPanelSize { inputPanelHideOffset += -accessoryPanelSize.height - additionalOffset