mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Voice Chat UI fixes
This commit is contained in:
@@ -39,6 +39,8 @@ public final class ToolbarNode: ASDisplayNode {
|
||||
|
||||
super.init()
|
||||
|
||||
self.isAccessibilityContainer = false
|
||||
|
||||
self.addSubnode(self.leftTitle)
|
||||
self.addSubnode(self.leftButton)
|
||||
self.addSubnode(self.rightTitle)
|
||||
@@ -63,6 +65,7 @@ public final class ToolbarNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
}
|
||||
self.leftButton.accessibilityTraits = .button
|
||||
self.rightButton.addTarget(self, action: #selector(self.rightPressed), forControlEvents: .touchUpInside)
|
||||
self.rightButton.highligthedChanged = { [weak self] highlighted in
|
||||
if let strongSelf = self {
|
||||
@@ -75,6 +78,7 @@ public final class ToolbarNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
}
|
||||
self.rightButton.accessibilityTraits = .button
|
||||
self.middleButton.addTarget(self, action: #selector(self.middlePressed), forControlEvents: .touchUpInside)
|
||||
self.middleButton.highligthedChanged = { [weak self] highlighted in
|
||||
if let strongSelf = self {
|
||||
@@ -87,6 +91,7 @@ public final class ToolbarNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
}
|
||||
self.middleButton.accessibilityTraits = .button
|
||||
}
|
||||
|
||||
public func updateTheme(_ theme: TabBarControllerTheme) {
|
||||
@@ -100,8 +105,14 @@ public final class ToolbarNode: ASDisplayNode {
|
||||
let sideInset: CGFloat = 16.0
|
||||
|
||||
self.leftTitle.attributedText = NSAttributedString(string: toolbar.leftAction?.title ?? "", font: Font.regular(17.0), textColor: (toolbar.leftAction?.isEnabled ?? false) ? self.theme.tabBarSelectedTextColor : self.theme.tabBarTextColor)
|
||||
self.leftButton.accessibilityLabel = toolbar.leftAction?.title
|
||||
|
||||
self.rightTitle.attributedText = NSAttributedString(string: toolbar.rightAction?.title ?? "", font: Font.regular(17.0), textColor: (toolbar.rightAction?.isEnabled ?? false) ? self.theme.tabBarSelectedTextColor : self.theme.tabBarTextColor)
|
||||
self.rightButton.accessibilityLabel = toolbar.rightAction?.title
|
||||
|
||||
self.middleTitle.attributedText = NSAttributedString(string: toolbar.middleAction?.title ?? "", font: Font.regular(17.0), textColor: (toolbar.middleAction?.isEnabled ?? false) ? self.theme.tabBarSelectedTextColor : self.theme.tabBarTextColor)
|
||||
self.middleButton.accessibilityLabel = toolbar.middleAction?.title
|
||||
|
||||
let leftSize = self.leftTitle.updateLayout(size)
|
||||
let rightSize = self.rightTitle.updateLayout(size)
|
||||
let middleSize = self.middleTitle.updateLayout(size)
|
||||
|
||||
Reference in New Issue
Block a user