Revision: 27740
          http://sourceforge.net/p/bibdesk/svn/27740
Author:   hofman
Date:     2022-07-18 18:06:58 +0000 (Mon, 18 Jul 2022)
Log Message:
-----------
accessibility actions and notifications for transient scale slider in fileview

Modified Paths:
--------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2022-07-18 
07:04:30 UTC (rev 27739)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2022-07-18 
18:06:58 UTC (rev 27740)
@@ -3214,6 +3214,8 @@
             
             [_sliderWindow fadeIn:self];
             [[self window] addChildWindow:_sliderWindow ordered:NSWindowAbove];
+            if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_8)
+                
NSAccessibilityPostNotificationWithUserInfo(NSAccessibilityUnignoredAncestor(self),
 NSAccessibilityLayoutChangedNotification, [NSDictionary 
dictionaryWithObjectsAndKeys:NSAccessibilityUnignoredChildren([NSArray 
arrayWithObjects:_sliderWindow, nil]), NSAccessibilityUIElementsKey, nil]);
         }
     }
     
@@ -4668,6 +4670,34 @@
 }
 #pragma clang diagnostic pop
 
+- (BOOL)isAccessibilityAlternateUIVisible {
+    return [_sliderWindow parentWindow] != nil;
+}
+
+// the following two method will only be called on 10.9+, so no need to check 
versions
+- (BOOL)accessibilityPerformShowAlternateUI {
+    if (_fvFlags.displayMode == FVDisplayModeGrid && [_sliderWindow 
parentWindow] == nil) {
+        NSRect sliderRect = [self _topSliderRect];
+        sliderRect = [self convertRect:sliderRect toView:nil];
+        sliderRect = [[self window] convertRectToScreen:sliderRect];
+        // looks cool to use -animator here, but makes it hard to hit...
+        if (NSEqualRects([[self _sliderWindow] frame], sliderRect) == NO)
+            [_sliderWindow setFrame:sliderRect display:NO];
+        
+        [_sliderWindow fadeIn:self];
+        [[self window] addChildWindow:_sliderWindow ordered:NSWindowAbove];
+        
NSAccessibilityPostNotificationWithUserInfo(NSAccessibilityUnignoredAncestor(self),
 NSAccessibilityLayoutChangedNotification, [NSDictionary 
dictionaryWithObjectsAndKeys:NSAccessibilityUnignoredChildren([NSArray 
arrayWithObjects:[_sliderWindow slider], nil]), NSAccessibilityUIElementsKey, 
nil]);
+    }
+    return YES;
+}
+
+- (BOOL)accessibilityPerformShowDefaultUI {
+    if ([_sliderWindow parentWindow] != nil) {
+        [_sliderWindow fadeOut:self];
+    }
+    return YES;
+}
+
 - (NSURL *)URLForIconElement:(FVAccessibilityIconElement *)element {
     return [self URLAtIndex:[element index]];
 }

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.m        2022-07-18 
07:04:30 UTC (rev 27739)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVSlider.m        2022-07-18 
18:06:58 UTC (rev 27740)
@@ -193,8 +193,11 @@
 }
 
 - (void)orderOut:(id)sender {
+    id view = NSAccessibilityUnignoredAncestor([_slider target]);
     [[self parentWindow] removeChildWindow:self];
     [super orderOut:self];
+    if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_8 && view)
+        NSAccessibilityPostNotificationWithUserInfo(view, 
NSAccessibilityLayoutChangedNotification, nil);
 }
 
 @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

Reply via email to