@@ -133,12 +133,11 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
133133 private let presentationContext : ChatPresentationContext ?
134134 private let strings : PresentationStrings
135135
136- public let micButtonBackgroundView : GlassBackgroundView
137136 public let micButtonTintMaskView : UIImageView
138137 public let micButton : ChatTextInputMediaRecordingButton
139138
140139 public let sendContainerNode : ASDisplayNode
141- public let sendButtonBackgroundView : GlassBackgroundView
140+ public let sendButtonBackgroundView : UIImageView
142141 public let sendButton : HighlightTrackingButtonNode
143142 public var sendButtonRadialStatusNode : ChatSendButtonRadialStatusNode ?
144143 public var sendButtonHasApplyIcon = false
@@ -147,7 +146,6 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
147146 public let textNode : ImmediateAnimatedCountLabelNode
148147
149148 public let expandMediaInputButton : HighlightTrackingButton
150- private let expandMediaInputButtonBackgroundView : GlassBackgroundView
151149 private let expandMediaInputButtonIcon : GlassBackgroundView . ContentImageView
152150
153151 private var effectBadgeView : EffectBadgeView ?
@@ -164,6 +162,8 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
164162 private var micButtonPointerInteraction : PointerInteraction ?
165163 private var sendButtonPointerInteraction : PointerInteraction ?
166164
165+ let maskContentView : UIView
166+
167167 private var validLayout : CGSize ?
168168
169169 public init ( context: AccountContext , presentationInterfaceState: ChatPresentationInterfaceState , presentationContext: ChatPresentationContext ? , presentController: @escaping ( ViewController ) -> Void ) {
@@ -173,31 +173,31 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
173173 let strings = presentationInterfaceState. strings
174174 self . strings = strings
175175
176- self . micButtonBackgroundView = GlassBackgroundView ( )
176+ self . maskContentView = UIView ( )
177+
177178 self . micButtonTintMaskView = UIImageView ( )
178179 self . micButtonTintMaskView. tintColor = . black
179180 self . micButton = ChatTextInputMediaRecordingButton ( context: context, theme: theme, pause: true , strings: strings, presentController: presentController)
180181 self . micButton. animationOutput = self . micButtonTintMaskView
181- self . micButtonBackgroundView . maskContentView. addSubview ( self . micButtonTintMaskView)
182+ self . maskContentView. addSubview ( self . micButtonTintMaskView)
182183
183184 self . sendContainerNode = ASDisplayNode ( )
184185 self . sendContainerNode. layer. allowsGroupOpacity = true
185186
186- self . sendButtonBackgroundView = GlassBackgroundView ( )
187+ self . sendButtonBackgroundView = UIImageView ( )
188+ self . sendButtonBackgroundView. image = generateStretchableFilledCircleImage ( diameter: 34.0 , color: . white) ? . withRenderingMode ( . alwaysTemplate)
187189 self . sendButton = HighlightTrackingButtonNode ( pointerStyle: nil )
188190
189191 self . textNode = ImmediateAnimatedCountLabelNode ( )
190192 self . textNode. isUserInteractionEnabled = false
191193
192194 self . expandMediaInputButton = HighlightTrackingButton ( )
193- self . expandMediaInputButtonBackgroundView = GlassBackgroundView ( )
194- self . expandMediaInputButtonBackgroundView. isUserInteractionEnabled = false
195- self . expandMediaInputButton. addSubview ( self . expandMediaInputButtonBackgroundView)
196195 self . expandMediaInputButtonIcon = GlassBackgroundView . ContentImageView ( )
197- self . expandMediaInputButtonBackgroundView . contentView . addSubview ( self . expandMediaInputButtonIcon)
196+ self . maskContentView . addSubview ( self . expandMediaInputButtonIcon. tintMask )
198197 self . expandMediaInputButtonIcon. image = PresentationResourcesChat . chatInputPanelExpandButtonImage ( presentationInterfaceState. theme)
199- self . expandMediaInputButtonIcon. tintColor = theme. chat. inputPanel. panelControlColor
200- self . expandMediaInputButtonIcon. setMonochromaticEffect ( tintColor: theme. chat. inputPanel. panelControlColor)
198+ self . expandMediaInputButtonIcon. tintColor = theme. chat. inputPanel. inputControlColor. withAlphaComponent ( 1.0 )
199+ self . expandMediaInputButtonIcon. setMonochromaticEffect ( tintColor: theme. chat. inputPanel. panelControlColor. withAlphaComponent ( 1.0 ) )
200+ self . expandMediaInputButtonIcon. alpha = theme. chat. inputPanel. panelControlColor. alpha
201201
202202 super. init ( )
203203
@@ -225,14 +225,14 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
225225 }
226226
227227 self . micButton. layer. allowsGroupOpacity = true
228- self . view. addSubview ( self . micButtonBackgroundView)
229228 self . view. addSubview ( self . micButton)
230229
231230 self . addSubnode ( self . sendContainerNode)
232231 self . sendContainerNode. view. addSubview ( self . sendButtonBackgroundView)
233232 self . sendContainerNode. addSubnode ( self . sendButton)
234233 self . sendContainerNode. addSubnode ( self . textNode)
235234 self . view. addSubview ( self . expandMediaInputButton)
235+ self . expandMediaInputButton. addSubview ( self . expandMediaInputButtonIcon)
236236
237237 self . expandMediaInputButton. highligthedChanged = { [ weak self] highlighted in
238238 guard let self else {
@@ -265,8 +265,9 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
265265
266266 public func updateTheme( theme: PresentationTheme , wallpaper: TelegramWallpaper ) {
267267 self . micButton. updateTheme ( theme: theme)
268- self . expandMediaInputButtonIcon. tintColor = theme. chat. inputPanel. panelControlColor
269- self . expandMediaInputButtonIcon. setMonochromaticEffect ( tintColor: theme. chat. inputPanel. panelControlColor)
268+ self . expandMediaInputButtonIcon. tintColor = theme. chat. inputPanel. panelControlColor. withAlphaComponent ( 1.0 )
269+ self . expandMediaInputButtonIcon. setMonochromaticEffect ( tintColor: theme. chat. inputPanel. panelControlColor. withAlphaComponent ( 1.0 ) )
270+ self . expandMediaInputButtonIcon. alpha = theme. chat. inputPanel. panelControlColor. alpha
270271 }
271272
272273 private var absoluteRect : ( CGRect , CGSize ) ?
@@ -285,6 +286,7 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
285286 self . validLayout = size
286287
287288 var innerSize = size
289+ innerSize. width = 38.0 + 3.0 * 2.0
288290
289291 var starsAmount : Int64 ?
290292 if let sendPaidMessageStars = interfaceState. sendPaidMessageStars, interfaceState. interfaceState. editMessage == nil {
@@ -334,24 +336,19 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
334336 self . sendButton. imageNode. alpha = 1.0
335337 self . textNode. isHidden = true
336338 }
337-
338- transition. updateFrame ( view: self . micButtonBackgroundView, frame: CGRect ( origin: CGPoint ( ) , size: size) )
339- self . micButtonBackgroundView. update ( size: size, cornerRadius: size. height * 0.5 , isDark: interfaceState. theme. overallDarkAppearance, tintColor: . init( kind: . panel, color: interfaceState. theme. chat. inputPanel. inputBackgroundColor. withMultipliedAlpha ( 0.7 ) ) , transition: ComponentTransition ( transition) )
340339
341- transition. updateFrame ( layer: self . micButton. layer, frame: CGRect ( origin: CGPoint ( ) , size: size) )
340+ transition. updateFrame ( layer: self . micButton. layer, frame: CGRect ( origin: CGPoint ( x : 7.0 , y : 0.0 ) , size: CGSize ( width : size. width - 7.0 , height : size . height ) ) )
342341 self . micButton. layoutItems ( )
343342
344- transition. updateFrame ( view: self . sendButtonBackgroundView, frame: CGRect ( origin: CGPoint ( ) , size: innerSize) )
345- self . sendButtonBackgroundView. update ( size : innerSize , cornerRadius : innerSize . height * 0.5 , isDark : interfaceState . theme . overallDarkAppearance , tintColor: . init ( kind : . custom , color : interfaceState. theme. chat. inputPanel. actionControlFillColor ) , transition : ComponentTransition ( transition ) )
343+ transition. updateFrame ( view: self . sendButtonBackgroundView, frame: CGRect ( origin: CGPoint ( ) , size: innerSize) . insetBy ( dx : 3.0 , dy : 3.0 ) )
344+ self . sendButtonBackgroundView. tintColor = interfaceState. theme. chat. inputPanel. panelControlAccentColor
346345 transition. updateFrame ( layer: self . sendButton. layer, frame: CGRect ( origin: CGPoint ( ) , size: innerSize) )
347346 transition. updateFrame ( node: self . sendContainerNode, frame: CGRect ( origin: CGPoint ( ) , size: innerSize) )
348347
349348 let backgroundSize = CGSize ( width: innerSize. width, height: 40.0 )
350349 let backgroundFrame = CGRect ( origin: CGPoint ( x: showTitle ? 5.0 + UIScreenPixel : floorToScreenPixels ( ( size. width - backgroundSize. width) / 2.0 ) , y: floorToScreenPixels ( ( size. height - backgroundSize. height) / 2.0 ) ) , size: backgroundSize)
351350
352351 transition. updateFrame ( view: self . expandMediaInputButton, frame: CGRect ( origin: CGPoint ( ) , size: size) )
353- transition. updateFrame ( view: self . expandMediaInputButtonBackgroundView, frame: CGRect ( origin: CGPoint ( ) , size: size) )
354- self . expandMediaInputButtonBackgroundView. update ( size: size, cornerRadius: size. height * 0.5 , isDark: interfaceState. theme. overallDarkAppearance, tintColor: . init( kind: . panel, color: interfaceState. theme. chat. inputPanel. inputBackgroundColor. withMultipliedAlpha ( 0.7 ) ) , transition: ComponentTransition ( transition) )
355352 if let image = self . expandMediaInputButtonIcon. image {
356353 let expandIconFrame = CGRect ( origin: CGPoint ( x: floor ( ( size. width - image. size. width) * 0.5 ) , y: floor ( ( size. height - image. size. height) * 0.5 ) ) , size: image. size)
357354 self . expandMediaInputButtonIcon. center = expandIconFrame. center
0 commit comments