diff --git a/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift b/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift index 3a56c9c409..c552349ab7 100644 --- a/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift @@ -1957,7 +1957,7 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg } menuButtonTitleTransition.updateFrame(node: self.menuButtonTextNode, frame: CGRect(origin: CGPoint(x: 16.0, y: 11.0), size: menuTextSize)) transition.updateAlpha(node: self.menuButtonTextNode, alpha: menuButtonExpanded ? 1.0 : 0.0) - transition.updateFrame(node: self.menuButtonIconNode, frame: CGRect(x: isSendAsButton ? 4.0 + UIScreenPixel : (4.0 + UIScreenPixel), y: isSendAsButton ? 5.0 : (5.0 - UIScreenPixel), width: 30.0, height: 30.0)) + transition.updateFrame(node: self.menuButtonIconNode, frame: CGRect(x: 5.0, y: isSendAsButton ? 5.0 : (5.0 - UIScreenPixel), width: 30.0, height: 30.0)) transition.updateFrame(node: self.sendAsAvatarButtonNode, frame: menuButtonFrame) transition.updateFrame(node: self.sendAsAvatarContainerNode, frame: CGRect(origin: CGPoint(), size: menuButtonFrame.size)) diff --git a/submodules/TelegramUI/Components/GlassBackgroundComponent/Sources/GlassBackgroundComponent.swift b/submodules/TelegramUI/Components/GlassBackgroundComponent/Sources/GlassBackgroundComponent.swift index a583e529dc..0ef6f84f20 100644 --- a/submodules/TelegramUI/Components/GlassBackgroundComponent/Sources/GlassBackgroundComponent.swift +++ b/submodules/TelegramUI/Components/GlassBackgroundComponent/Sources/GlassBackgroundComponent.swift @@ -404,34 +404,34 @@ public class GlassBackgroundView: UIView { let shadowInset: CGFloat = 32.0 + if let innerColor = tintColor.innerColor { + let innerBackgroundFrame = CGRect(origin: CGPoint(), size: size).insetBy(dx: 3.0, dy: 3.0) + let innerBackgroundRadius = min(innerBackgroundFrame.width, innerBackgroundFrame.height) * 0.5 + + let innerBackgroundView: UIView + if let current = self.innerBackgroundView { + innerBackgroundView = current + } else { + innerBackgroundView = UIView() + self.innerBackgroundView = innerBackgroundView + self.contentView.insertSubview(innerBackgroundView, at: 0) + + innerBackgroundView.frame = innerBackgroundFrame + innerBackgroundView.layer.cornerRadius = innerBackgroundRadius + } + + innerBackgroundView.backgroundColor = innerColor + transition.setFrame(view: innerBackgroundView, frame: innerBackgroundFrame) + transition.setCornerRadius(layer: innerBackgroundView.layer, cornerRadius: innerBackgroundRadius) + } else if let innerBackgroundView = self.innerBackgroundView { + self.innerBackgroundView = nil + innerBackgroundView.removeFromSuperview() + } + let params = Params(cornerRadius: cornerRadius, isDark: isDark, tintColor: tintColor, isInteractive: isInteractive) if self.params != params { self.params = params - if let innerColor = params.tintColor.innerColor { - let innerBackgroundFrame = CGRect(origin: CGPoint(), size: size).insetBy(dx: 3.0, dy: 3.0) - let innerBackgroundRadius = min(innerBackgroundFrame.width, innerBackgroundFrame.height) * 0.5 - - let innerBackgroundView: UIView - if let current = self.innerBackgroundView { - innerBackgroundView = current - } else { - innerBackgroundView = UIView() - self.innerBackgroundView = innerBackgroundView - self.contentView.insertSubview(innerBackgroundView, at: 0) - - innerBackgroundView.frame = innerBackgroundFrame - innerBackgroundView.layer.cornerRadius = innerBackgroundRadius - } - - innerBackgroundView.backgroundColor = innerColor - transition.setFrame(view: innerBackgroundView, frame: innerBackgroundFrame) - transition.setCornerRadius(layer: innerBackgroundView.layer, cornerRadius: innerBackgroundRadius) - } else if let innerBackgroundView = self.innerBackgroundView { - self.innerBackgroundView = nil - innerBackgroundView.removeFromSuperview() - } - if let shadowView = self.shadowView { let shadowInnerInset: CGFloat = 0.5 shadowView.image = generateImage(CGSize(width: shadowInset * 2.0 + cornerRadius * 2.0, height: shadowInset * 2.0 + cornerRadius * 2.0), rotatedContext: { size, context in