Skip to content
This repository was archived by the owner on Nov 19, 2019. It is now read-only.

Commit 6a0b433

Browse files
committed
Fix accessibility of PSMTabBarCell
* implemented visual bounds - yields proper VoiceOver cursor bounds, proper order of presentation in sequentional navigation (VO-left and right arrows), and also enables touch exploration * implemented AXValue - so that the selected tab can announce itself as such (AXFocused is for elements having keyboard focus, i.e. being first responder, which is something quite different than being selected from a list of other options)
1 parent d85e387 commit 6a0b433

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Source/PSMTabBarCell.m

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,8 +740,17 @@ - (id)accessibilityAttributeValue:(NSString *)attribute {
740740
} else {
741741
attributeValue = [self stringValue];
742742
}
743-
} else if([attribute isEqualToString: NSAccessibilityFocusedAttribute]) {
744-
attributeValue = [NSNumber numberWithBool:([self tabState] == 2)];
743+
} else if([attribute isEqualToString: NSAccessibilityValueAttribute]) {
744+
attributeValue = [NSNumber numberWithBool:([self tabState] & PSMTab_SelectedMask)];
745+
} else if ([attribute isEqualToString:NSAccessibilityPositionAttribute] || [attribute isEqualToString:NSAccessibilitySizeAttribute]) {
746+
NSRect rect = [self frame];
747+
rect = [[self controlView] convertRect:rect toView:nil];
748+
rect = [[[self controlView] window] convertRectToScreen:rect];
749+
if ([attribute isEqualToString:NSAccessibilityPositionAttribute])
750+
attributeValue = [NSValue valueWithPoint:rect.origin];
751+
else
752+
attributeValue = [NSValue valueWithSize:rect.size];
753+
745754
} else {
746755
attributeValue = [super accessibilityAttributeValue:attribute];
747756
}

0 commit comments

Comments
 (0)