mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-28 00:04:25 +00:00
Remove "optional" from accessibility feed label. Make sure subviews are not accessibility elements.
This commit is contained in:
1 parent
300b54146f
commit
c1b4cfec4f
3 files changed
+19
-4
No files matched your search
@@ -70,6 +70,10 @@ final class MainFeedCollectionHeaderReusableView: UICollectionReusableView {
|
||||
override func awakeFromNib() {
|
||||
MainActor.assumeIsolated {
|
||||
super.awakeFromNib()
|
||||
isAccessibilityElement = true
|
||||
headerTitle.isAccessibilityElement = false
|
||||
unreadCountLabel.isAccessibilityElement = false
|
||||
disclosureIndicator.isAccessibilityElement = false
|
||||
unreadLabelWidthConstraint = unreadCountLabel.widthAnchor.constraint(lessThanOrEqualToConstant: 80)
|
||||
unreadLabelWidthConstraint?.isActive = true
|
||||
configureUI()
|
||||
|
||||
@@ -62,11 +62,12 @@ final class MainFeedCollectionViewCell: UICollectionViewCell {
|
||||
|
||||
override var accessibilityLabel: String? {
|
||||
get {
|
||||
let name = feedTitle.text ?? ""
|
||||
if unreadCount > 0 {
|
||||
let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessibility")
|
||||
return "\(String(describing: feedTitle.text)) \(unreadCount) \(unreadLabel)"
|
||||
return "\(name) \(unreadCount) \(unreadLabel)"
|
||||
} else {
|
||||
return (String(describing: feedTitle.text))
|
||||
return name
|
||||
}
|
||||
}
|
||||
set {}
|
||||
@@ -75,6 +76,10 @@ final class MainFeedCollectionViewCell: UICollectionViewCell {
|
||||
override func awakeFromNib() {
|
||||
MainActor.assumeIsolated {
|
||||
super.awakeFromNib()
|
||||
isAccessibilityElement = true
|
||||
feedTitle.isAccessibilityElement = false
|
||||
unreadCountLabel.isAccessibilityElement = false
|
||||
faviconView.isAccessibilityElement = false
|
||||
faviconLeadingConstraint = faviconView.leadingAnchor.constraint(equalTo: contentView.safeAreaLayoutGuide.leadingAnchor)
|
||||
faviconLeadingConstraint?.isActive = true
|
||||
}
|
||||
|
||||
@@ -58,6 +58,11 @@ class MainFeedCollectionViewFolderCell: UICollectionViewCell {
|
||||
override func awakeFromNib() {
|
||||
MainActor.assumeIsolated {
|
||||
super.awakeFromNib()
|
||||
isAccessibilityElement = true
|
||||
folderTitle.isAccessibilityElement = false
|
||||
unreadCountLabel.isAccessibilityElement = false
|
||||
faviconView.isAccessibilityElement = false
|
||||
disclosureButton.isAccessibilityElement = false
|
||||
disclosureButton.addInteraction(UIPointerInteraction())
|
||||
}
|
||||
}
|
||||
@@ -99,11 +104,12 @@ class MainFeedCollectionViewFolderCell: UICollectionViewCell {
|
||||
|
||||
override var accessibilityLabel: String? {
|
||||
get {
|
||||
let name = folderTitle.text ?? ""
|
||||
if unreadCount > 0 {
|
||||
let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessibility")
|
||||
return "\(String(describing: folderTitle.text)) \(unreadCount) \(unreadLabel)"
|
||||
return "\(name) \(unreadCount) \(unreadLabel)"
|
||||
} else {
|
||||
return (String(describing: folderTitle.text))
|
||||
return name
|
||||
}
|
||||
}
|
||||
set {}
|
||||
|
||||
Reference in new issue
Block a user