This commit is contained in:
Isaac
2025-10-03 22:05:29 +08:00
parent 35d6c16fc5
commit a2797c4b49
2 changed files with 25 additions and 25 deletions

View File

@@ -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)) 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.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.sendAsAvatarButtonNode, frame: menuButtonFrame)
transition.updateFrame(node: self.sendAsAvatarContainerNode, frame: CGRect(origin: CGPoint(), size: menuButtonFrame.size)) transition.updateFrame(node: self.sendAsAvatarContainerNode, frame: CGRect(origin: CGPoint(), size: menuButtonFrame.size))

View File

@@ -404,34 +404,34 @@ public class GlassBackgroundView: UIView {
let shadowInset: CGFloat = 32.0 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) let params = Params(cornerRadius: cornerRadius, isDark: isDark, tintColor: tintColor, isInteractive: isInteractive)
if self.params != params { if self.params != params {
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 { if let shadowView = self.shadowView {
let shadowInnerInset: CGFloat = 0.5 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 shadowView.image = generateImage(CGSize(width: shadowInset * 2.0 + cornerRadius * 2.0, height: shadowInset * 2.0 + cornerRadius * 2.0), rotatedContext: { size, context in