Revision: 13566
http://sourceforge.net/p/skim-app/code/13566
Author: hofman
Date: 2023-08-06 22:47:41 +0000 (Sun, 06 Aug 2023)
Log Message:
-----------
Create navWindow lazily when needed. Don't show navWindow when activating
everywhere and cursorWindow is visible.
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2023-08-06 15:47:05 UTC (rev 13565)
+++ trunk/SKPDFView.m 2023-08-06 22:47:41 UTC (rev 13566)
@@ -321,6 +321,7 @@
laserPointerColor = [[NSUserDefaults standardUserDefaults]
integerForKey:SKLaserPointerColorKey];
navWindow = nil;
+ cursorWindow = nil;
readingBar = nil;
@@ -2065,8 +2066,10 @@
}
}
- if (navWindow && [navWindow isVisible] == NO) {
- if (navigationMode == SKNavigationEverywhere &&
NSPointInRect([theEvent locationInWindow], [[[self window] contentView]
frame])) {
+ if (navigationMode != SKNavigationNone && [navWindow isVisible] == NO) {
+ if (navigationMode == SKNavigationEverywhere && [cursorWindow
isVisible] == NO && NSPointInRect([theEvent locationInWindow], [[[self window]
contentView] frame])) {
+ if (navWindow == nil)
+ navWindow = [[SKNavigationWindow alloc] initWithPDFView:self];
[navWindow showForWindow:[self window]];
NSAccessibilityPostNotificationWithUserInfo(NSAccessibilityUnignoredAncestor([self
documentView]), NSAccessibilityLayoutChangedNotification, [NSDictionary
dictionaryWithObjectsAndKeys:NSAccessibilityUnignoredChildrenForOnlyChild(navWindow),
NSAccessibilityUIElementsKey, nil]);
} else if (navigationMode == SKNavigationBottom &&
NSPointInRect([theEvent locationInWindow], SKSliceRect([[[self window]
contentView] frame], NAVIGATION_BOTTOM_EDGE_HEIGHT, NSMinYEdge))) {
@@ -3496,10 +3499,6 @@
- (void)enableNavigation {
navigationMode = [[NSUserDefaults standardUserDefaults]
integerForKey:SKPresentationNavigationOptionKey];
-
- if (navigationMode != SKNavigationNone)
- navWindow = [[SKNavigationWindow alloc] initWithPDFView:self];
-
[self performSelectorOnce:@selector(doAutoHide)
afterDelay:AUTO_HIDE_DELAY];
}
@@ -3531,6 +3530,8 @@
- (void)showNavWindow {
if ([navWindow isVisible] == NO && NSPointInRect([[self window]
mouseLocationOutsideOfEventStream], SKSliceRect([[[self window] contentView]
frame], NAVIGATION_BOTTOM_EDGE_HEIGHT, NSMinYEdge))) {
+ if (navWindow == nil)
+ navWindow = [[SKNavigationWindow alloc] initWithPDFView:self];
[navWindow showForWindow:[self window]];
NSAccessibilityPostNotificationWithUserInfo(NSAccessibilityUnignoredAncestor([self
documentView]), NSAccessibilityLayoutChangedNotification, [NSDictionary
dictionaryWithObjectsAndKeys:NSAccessibilityUnignoredChildrenForOnlyChild(navWindow),
NSAccessibilityUIElementsKey, nil]);
}
@@ -5467,7 +5468,7 @@
- (BOOL)isAccessibilityAlternateUIVisible{
if (interactionMode == SKPresentationMode) {
- return [navWindow isVisible];
+ return [navWindow isVisible] || [cursorWindow isVisible];
} else {
return [[self delegate]
respondsToSelector:@selector(PDFViewIsFindVisible:)] && [[self delegate]
PDFViewIsFindVisible:self];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit