Various improvements

This commit is contained in:
Isaac
2025-10-11 00:56:21 +08:00
parent e3ee0126b2
commit b9b38e5fbf
87 changed files with 1337 additions and 498 deletions

View File

@@ -160,9 +160,9 @@ public final class MessageInputActionButtonComponent: Component {
case up
}
public enum Style {
public enum Style: Equatable {
case legacy
case glass
case glass(isTinted: Bool)
}
public let mode: Mode
@@ -519,7 +519,7 @@ public final class MessageInputActionButtonComponent: Component {
microphoneAlpha = 0.4
}
if component.style == .glass, [.send, .close].contains(component.mode) {
if case let .glass(isTinted) = component.style {
let backgroundView: GlassBackgroundView
if let current = self.backgroundView {
backgroundView = current
@@ -534,8 +534,16 @@ public final class MessageInputActionButtonComponent: Component {
if case .send = component.mode {
tintColor = UIColor(rgb: 0x029dff)
}
let glassTint: GlassBackgroundView.TintColor
if isTinted {
glassTint = .init(kind: tintKind, color: tintColor)
} else {
glassTint = .init(kind: .panel, color: defaultDarkPresentationTheme.chat.inputPanel.inputBackgroundColor.withMultipliedAlpha(0.7))
}
let buttonSize = CGSize(width: 40.0, height: 40.0)
backgroundView.update(size: buttonSize, cornerRadius: buttonSize.height / 2.0, isDark: true, tintColor: .init(kind: tintKind, color: tintColor), transition: transition)
backgroundView.update(size: buttonSize, cornerRadius: buttonSize.height / 2.0, isDark: true, tintColor: glassTint, transition: transition)
backgroundView.frame = CGRect(origin: .zero, size: buttonSize)
}