From e46ea56af99d7dfd1535c77e67b2edc3ed895a82 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Thu, 17 Jan 2013 09:15:21 +0100 Subject: [PATCH] Exclude gutter from accessibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was read as “empty scroll view” (using voice over), so better to skip it. --- Frameworks/OakTextView/src/OakDocumentView.mm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Frameworks/OakTextView/src/OakDocumentView.mm b/Frameworks/OakTextView/src/OakDocumentView.mm index ed276fa7..2d93898f 100644 --- a/Frameworks/OakTextView/src/OakDocumentView.mm +++ b/Frameworks/OakTextView/src/OakDocumentView.mm @@ -21,6 +21,16 @@ OAK_DEBUG_VAR(OakDocumentView); static NSString* const kBookmarksColumnIdentifier = @"bookmarks"; static NSString* const kFoldingsColumnIdentifier = @"foldings"; +@interface OakDisableAccessibilityScrollView : NSScrollView +@end + +@implementation OakDisableAccessibilityScrollView +- (BOOL)accessibilityIsIgnored +{ + return YES; +} +@end + @interface OakDocumentView () @property (nonatomic, readonly) OTVStatusBar* statusBar; @property (nonatomic, retain) NSDictionary* gutterImages; @@ -89,7 +99,7 @@ private: [gutterView insertColumnWithIdentifier:kBookmarksColumnIdentifier atPosition:0 dataSource:self delegate:self]; [gutterView insertColumnWithIdentifier:kFoldingsColumnIdentifier atPosition:2 dataSource:self delegate:self]; - gutterScrollView = [[NSScrollView alloc] initWithFrame:NSZeroRect]; + gutterScrollView = [[OakDisableAccessibilityScrollView alloc] initWithFrame:NSZeroRect]; gutterScrollView.borderType = NSNoBorder; gutterScrollView.documentView = gutterView; [self addSubview:gutterScrollView];