mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Accessibility improvements
This commit is contained in:
@@ -118,6 +118,8 @@ final class CommandMenuChatInputPanelItemNode: ListViewItemNode {
|
||||
private let backgroundNode: ASDisplayNode
|
||||
private let highlightedBackgroundNode: ASDisplayNode
|
||||
|
||||
private let activateAreaNode: AccessibilityAreaNode
|
||||
|
||||
init() {
|
||||
self.textNode = TextNode()
|
||||
self.commandNode = TextNode()
|
||||
@@ -139,6 +141,9 @@ final class CommandMenuChatInputPanelItemNode: ListViewItemNode {
|
||||
self.backgroundNode = ASDisplayNode()
|
||||
self.backgroundNode.clipsToBounds = true
|
||||
|
||||
self.activateAreaNode = AccessibilityAreaNode()
|
||||
self.activateAreaNode.accessibilityTraits = [.button]
|
||||
|
||||
super.init(layerBacked: false, dynamicBounce: false)
|
||||
|
||||
self.addSubnode(self.clippingNode)
|
||||
@@ -148,6 +153,8 @@ final class CommandMenuChatInputPanelItemNode: ListViewItemNode {
|
||||
self.backgroundNode.addSubnode(self.textNode)
|
||||
self.backgroundNode.addSubnode(self.commandNode)
|
||||
self.backgroundNode.addSubnode(self.separatorNode)
|
||||
|
||||
self.addSubnode(self.activateAreaNode)
|
||||
}
|
||||
|
||||
override func didLoad() {
|
||||
@@ -227,6 +234,10 @@ final class CommandMenuChatInputPanelItemNode: ListViewItemNode {
|
||||
|
||||
strongSelf.highlightedBackgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: params.width, height: nodeLayout.size.height + UIScreenPixel))
|
||||
|
||||
strongSelf.activateAreaNode.accessibilityLabel = textString.string
|
||||
strongSelf.activateAreaNode.accessibilityValue = commandString.string
|
||||
strongSelf.activateAreaNode.frame = CGRect(origin: .zero, size: nodeLayout.size)
|
||||
|
||||
if !mergedTop {
|
||||
strongSelf.shadowNode.isHidden = false
|
||||
strongSelf.shadowNode.frame = CGRect(origin: CGPoint(x: -shadowBlur, y: 0.0), size: CGSize(width: nodeLayout.size.width + shadowBlur * 2.0, height: backgroundCornerRadius + shadowBlur))
|
||||
|
||||
Reference in New Issue
Block a user