Revision: 27735
http://sourceforge.net/p/bibdesk/svn/27735
Author: hofman
Date: 2022-07-14 08:51:57 +0000 (Thu, 14 Jul 2022)
Log Message:
-----------
accessibility labels for finder label items
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m 2022-07-13
21:43:25 UTC (rev 27734)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m 2022-07-14
08:51:57 UTC (rev 27735)
@@ -316,6 +316,17 @@
[NSGraphicsContext restoreGraphicsState];
}
+- (id)accessibilityAttributeValue:(NSString *)attribute {
+ if ([attribute isEqualToString:NSAccessibilityTitleAttribute])
+ return 0 == [self tag] ? nil : [FVFinderLabel
localizedNameForLabel:[self tag]];
+ else
+ return [super accessibilityAttributeValue:attribute];
+}
+
+- (NSString *)accessibilityLabel {
+ return 0 == [self tag] ? nil : [FVFinderLabel localizedNameForLabel:[self
tag]];
+}
+
@end
@implementation FVColorMenuMatrix
@@ -410,4 +421,25 @@
return 0 == [cell tag] ? @"" : [NSString stringWithFormat:@"%C%@%C",
(unichar)0x201C, [FVFinderLabel localizedNameForLabel:[cell tag]],
(unichar)0x201D];
}
+- (NSArray *)accessibilityAttributeNames {
+ static NSArray *attributes = nil;
+ if (attributes == nil)
+ attributes = [[[super accessibilityAttributeNames]
arrayByAddingObject:NSAccessibilityTitleAttribute] retain];
+ return attributes;
+}
+
+- (id)accessibilityAttributeValue:(NSString *)attribute {
+ if ([attribute isEqualToString:NSAccessibilityTitleAttribute]) {
+ NSBundle *bundle = [NSBundle bundleForClass:[FVColorMenuView self]];
+ return NSLocalizedStringFromTableInBundle(@"Label:", @"FileView",
bundle, @"Finder label menu item title");
+ } else {
+ return [super accessibilityAttributeValue:attribute];
+ }
+}
+
+- (NSString *)accessibilityLabel {
+ NSBundle *bundle = [NSBundle bundleForClass:[FVColorMenuView self]];
+ return NSLocalizedStringFromTableInBundle(@"Label:", @"FileView", bundle,
@"Finder label menu item title");
+}
+
@end
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit