Skip to content

Commit eb80808

Browse files
committed
• Added some features to make views ignorable by VoiceOver.
1 parent ce87f76 commit eb80808

4 files changed

+68
-5
lines changed

SSYLineBox.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22

33
/*!
44
@brief Subclass of NSBox which makes collapses into a grayscale vertical or
5-
horizontal line, with whiteness=0.2, alpha=1.0, thickness=1.0 point, restoring
6-
the darkness of the "Vertical Line" and "Horizontal Line" object that became
7-
too white in macOS 10.10.
5+
horizontal line, with whiteness=0.2, alpha=1.0, thickness=1.0 point, and is
6+
ignored by VoiceOver.
87
9-
@details This subclass is useful in macOS 10.10 Yosemite. For some
8+
@details This subclass is useful in macOS 10.10 or later. For some
109
reason, the "Vertical Line" and "Horizontal Line" NSBox objects in the
1110
xib library, which produce a fairly dark line in earlier versions of macOS,
1211
produce a very light gray line in macOS 10.10 that is barely discernable on
1312
a white background. Just change the object class of your Vertical Line and
14-
Horizontal Line objects from NSBox to SSYLineBox
13+
Horizontal Line objects from NSBox to SSYLineBox.
1514
*/
1615
@interface SSYLineBox : NSBox
1716

SSYLineBox.m

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ @implementation SSYLineBox
66
#define DESIRED_ALPHA 1.0
77
#define DESIRED_THICKNESS 1.0
88

9+
- (void)awakeFromNib {
10+
self.accessibilityElement = NO;
11+
}
12+
913
- (void)drawRect:(NSRect)dirtyRect {
1014
NSColor* color = [NSColor colorWithCalibratedWhite:DESIRED_WHITENESS
1115
alpha:DESIRED_ALPHA] ;

SSYNoVoiceOverControls.h

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#import <Foundation/Foundation.h>
2+
3+
/*!
4+
@brief Image view which will be skipped over by VoiceOver
5+
6+
@details Be careful that you *really* want the view to be skipped over by
7+
VoiceOver, because its meaning is conveyed in a better, non-visual way,
8+
elsewhere. Remember that not all VoiceOver users are completely blind.
9+
*/
10+
@interface SSYNoVoiceOverImageView : NSImageView {}
11+
@end
12+
13+
/*!
14+
@brief Button which will be skipped over by VoiceOver
15+
16+
@details Be careful that you *really* want the button to be skipped over by
17+
VoiceOver, because its meaning is conveyed in a better, non-visual way,
18+
elsewhere. Remember that not all VoiceOver users are completely blind.
19+
*/
20+
@interface SSYNoVoiceOverButton : NSButton {}
21+
@end
22+
23+
/*!
24+
@brief Text field which will be skipped over by VoiceOver
25+
26+
@details Be careful that you *really* want the field to be skipped over by
27+
VoiceOver, because its meaning is conveyed in a better, non-visual way,
28+
elsewhere. Remember that not all VoiceOver users are completely blind.
29+
*/
30+
@interface SSYNoVoiceOverTextField : NSTextField {}
31+
@end
32+

SSYNoVoiceOverControls.m

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#import "SSYNoVoiceOverControls.h"
2+
3+
@implementation SSYNoVoiceOverImageView
4+
5+
- (void)awakeFromNib {
6+
self.cell.accessibilityElement = NO;
7+
}
8+
9+
@end
10+
11+
12+
@implementation SSYNoVoiceOverButton
13+
14+
- (void)awakeFromNib {
15+
self.cell.accessibilityElement = NO;
16+
}
17+
18+
@end
19+
20+
21+
@implementation SSYNoVoiceOverTextField
22+
23+
- (void)awakeFromNib {
24+
self.cell.accessibilityElement = NO;
25+
}
26+
27+
@end
28+

0 commit comments

Comments
 (0)