mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Various improvements
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user