added accessibility label for sidebar cell

This commit is contained in:
Maurice Parker 2019-02-06 14:37:58 -06:00
parent a09e4fdd2a
commit a520cdfa4b
1 changed files with 10 additions and 0 deletions

View File

@ -127,6 +127,16 @@ class SidebarCell : NSTableCellView {
let layout = SidebarCellLayout(appearance: cellAppearance, cellSize: bounds.size, shouldShowImage: shouldShowImage, textField: textField, unreadCountView: unreadCountView) let layout = SidebarCellLayout(appearance: cellAppearance, cellSize: bounds.size, shouldShowImage: shouldShowImage, textField: textField, unreadCountView: unreadCountView)
layoutWith(layout) layoutWith(layout)
} }
override func accessibilityLabel() -> String? {
if unreadCount > 0 {
let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessiblity")
return "\(name) \(unreadCount) \(unreadLabel)"
} else {
return name
}
}
} }
private extension SidebarCell { private extension SidebarCell {