Skip to content

Commit 08fae7b

Browse files
author
Isaac
committed
Update
1 parent 948a99a commit 08fae7b

File tree

5 files changed

+26
-16
lines changed

5 files changed

+26
-16
lines changed

submodules/ChatSendMessageActionUI/Sources/SendButton.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ final class SendButton: HighlightTrackingButton {
7070
size: CGSize,
7171
transition: ComponentTransition
7272
) {
73-
let innerSize = CGSize(width: size.width - 3.0 * 2.0, height: size.height - 3.0 * 2.0)
73+
let innerSize: CGSize
74+
if size.height == 40.0 {
75+
innerSize = CGSize(width: size.width - 3.0 * 2.0, height: size.height - 3.0 * 2.0)
76+
} else {
77+
innerSize = CGSize(width: isAnimatedIn ? 38.0 : size.width - 5.0 * 2.0, height: 33.0)
78+
}
7479
let containerFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - innerSize.width) * 0.5), y: floorToScreenPixels((size.height - innerSize.height) * 0.5)), size: innerSize)
7580
transition.setFrame(view: self.containerView, frame: containerFrame)
7681
transition.setCornerRadius(layer: self.containerView.layer, cornerRadius: innerSize.height * 0.5)

submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private func calculateTextFieldRealInsets(presentationInterfaceState: ChatPresen
112112
var right: CGFloat = 0.0
113113
right += max(0.0, accessoryButtonsWidth - 14.0)
114114
if actionControlsWidth != 0.0 {
115-
right += actionControlsWidth
115+
right += actionControlsWidth - 14.0
116116
}
117117

118118
return UIEdgeInsets(top: 4.5 + top, left: 0.0, bottom: 5.5 + bottom, right: right)
@@ -1876,7 +1876,7 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
18761876

18771877
var leftInset = leftInset
18781878

1879-
var textInputBackgroundWidthOffset: CGFloat = 0.0
1879+
let textInputBackgroundWidthOffset: CGFloat = 0.0
18801880
var attachmentButtonX: CGFloat = hideOffset.x + leftInset + leftMenuInset + 8.0
18811881
if !displayMediaButton || mediaRecordingState != nil {
18821882
attachmentButtonX = -48.0
@@ -2241,11 +2241,7 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
22412241

22422242
leftInset += leftMenuInset
22432243

2244-
var composeButtonsOffset: CGFloat = 0.0
2245-
if self.extendedSearchLayout {
2246-
composeButtonsOffset = 40.0
2247-
textInputBackgroundWidthOffset = 36.0
2248-
}
2244+
let composeButtonsOffset: CGFloat = 0.0
22492245

22502246
self.updateCounterTextNode(transition: transition)
22512247

@@ -2493,7 +2489,7 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
24932489

24942490
var nextButtonTopRight = CGPoint(x: textInputContainerBackgroundFrame.width - accessoryButtonInset - rightSlowModeInset - actionButtonsSize.width + (inputHasText ? 4.0 : (8.0 + 1.0)), y: textInputContainerBackgroundFrame.height - minimalInputHeight)
24952491
if self.extendedSearchLayout {
2496-
nextButtonTopRight.x -= 26.0
2492+
nextButtonTopRight.x += 8.0 + 1.0
24972493
}
24982494
for (item, button) in self.accessoryItemButtons.reversed() {
24992495
let buttonSize = CGSize(width: button.buttonWidth, height: minimalInputHeight)

submodules/TelegramUI/Components/EntityKeyboard/Sources/GifPagerContentComponent.swift

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,8 @@ public final class GifPagerContentComponent: Component {
463463
}
464464
}
465465

466+
private let clippingView: UIView
467+
466468
private let shimmerHostView: PortalSourceView
467469
private let standaloneShimmerEffect: StandaloneShimmerEffect
468470

@@ -487,6 +489,9 @@ public final class GifPagerContentComponent: Component {
487489
private var currentLoadMoreToken: String?
488490

489491
override init(frame: CGRect) {
492+
self.clippingView = UIView()
493+
self.clippingView.clipsToBounds = true
494+
490495
self.shimmerHostView = PortalSourceView()
491496
self.standaloneShimmerEffect = StandaloneShimmerEffect()
492497

@@ -508,8 +513,10 @@ public final class GifPagerContentComponent: Component {
508513

509514
super.init(frame: frame)
510515

516+
self.addSubview(self.clippingView)
517+
511518
self.shimmerHostView.alpha = 0.0
512-
self.addSubview(self.shimmerHostView)
519+
self.clippingView.addSubview(self.shimmerHostView)
513520

514521
self.scrollView.delaysContentTouches = false
515522
if #available(iOSApplicationExtension 11.0, iOS 11.0, *) {
@@ -524,10 +531,10 @@ public final class GifPagerContentComponent: Component {
524531
self.scrollView.delegate = self
525532

526533
self.scrollClippingView.addSubview(self.scrollView)
527-
self.addSubview(self.scrollClippingView)
534+
self.clippingView.addSubview(self.scrollClippingView)
528535

529536
self.scrollView.addSubview(self.placeholdersContainerView)
530-
self.addSubview(self.searchHeaderContainer)
537+
self.clippingView.addSubview(self.searchHeaderContainer)
531538

532539
self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.tapGesture(_:))))
533540

@@ -873,6 +880,8 @@ public final class GifPagerContentComponent: Component {
873880
externalTintMaskContainer.addSubview(self.mirrorSearchHeaderContainer)
874881
}
875882
}
883+
884+
transition.setFrame(view: self.clippingView, frame: CGRect(origin: CGPoint(), size: CGSize(width: backgroundFrame.width, height: max(0.0, backgroundFrame.height - bottomPanelHeight))))
876885
}
877886

878887
func update(component: GifPagerContentComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment<EnvironmentType>, transition: ComponentTransition) -> CGSize {

submodules/TelegramUI/Components/GlassBackgroundComponent/Sources/GlassBackgroundComponent.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,12 +738,12 @@ public extension GlassBackgroundView {
738738
addShadow(context, false, CGPoint(x: 0.64, y: 0.64), 0.8, 0.0, UIColor(white: 1.0, alpha: edgeAlpha), .normal)
739739
}
740740
} else if b >= 0.2 {
741-
let edgeAlpha: CGFloat = max(0.2, min(isDark ? 0.7 : 0.7, a * a * a))
741+
let edgeAlpha: CGFloat = max(0.2, min(isDark ? 0.5 : 0.7, a * a * a))
742742

743743
addShadow(context, false, CGPoint(x: -0.64, y: -0.64), 0.5, 0.0, UIColor(white: 1.0, alpha: edgeAlpha), .plusLighter)
744744
addShadow(context, false, CGPoint(x: 0.64, y: 0.64), 0.5, 0.0, UIColor(white: 1.0, alpha: edgeAlpha), .plusLighter)
745745
} else {
746-
let edgeAlpha: CGFloat = max(0.4, min(1.0, a * a * a))
746+
let edgeAlpha: CGFloat = max(0.4, min(isDark ? 0.5 : 0.7, a * a * a))
747747

748748
addShadow(context, false, CGPoint(x: -0.64, y: -0.64), 1.2, 0.0, UIColor(white: 1.0, alpha: edgeAlpha), .normal)
749749
addShadow(context, false, CGPoint(x: 0.64, y: 0.64), 1.2, 0.0, UIColor(white: 1.0, alpha: edgeAlpha), .normal)

submodules/TelegramUI/Sources/ChatControllerNode.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,8 +2145,8 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate {
21452145
if case let .media(_, expanded, _) = self.chatPresentationInterfaceState.inputMode, expanded != nil {
21462146
additionalOffset = 80.0
21472147
}
2148-
if let inputPanelSize = inputPanelSize {
2149-
inputPanelHideOffset += -inputPanelSize.height - additionalOffset
2148+
if let _ = inputPanelSize {
2149+
inputPanelHideOffset += -40.0 - additionalOffset
21502150
}
21512151
if let accessoryPanelSize = accessoryPanelSize {
21522152
inputPanelHideOffset += -accessoryPanelSize.height - additionalOffset

0 commit comments

Comments
 (0)