Revision: 2715
http://skim-app.svn.sourceforge.net/skim-app/?rev=2715&view=rev
Author: hofman
Date: 2007-08-23 10:39:40 -0700 (Thu, 23 Aug 2007)
Log Message:
-----------
Separate methods to enable and disable navigation window.
Modified Paths:
--------------
trunk/SKMainWindowController.m
trunk/SKPDFView.h
trunk/SKPDFView.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2007-08-23 15:31:23 UTC (rev 2714)
+++ trunk/SKMainWindowController.m 2007-08-23 17:39:40 UTC (rev 2715)
@@ -2177,7 +2177,7 @@
if ([fullScreenSetup count])
[self applyPDFSettings:fullScreenSetup];
- [pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults
standardUserDefaults] boolForKey:SKActivateFullScreenNavigationAtBottomKey]
autohidesCursor:NO screen:screen];
+ [pdfView enableNavigationActivatedAtBottom:[[NSUserDefaults
standardUserDefaults] boolForKey:SKActivateFullScreenNavigationAtBottomKey]
autohidesCursor:NO screen:screen];
[self showSideWindowsOnScreen:screen];
}
@@ -2200,7 +2200,7 @@
else
[self goFullScreen];
- [pdfView setHasNavigation:YES activateAtBottom:[[NSUserDefaults
standardUserDefaults] boolForKey:SKActivatePresentationNavigationAtBottomKey]
autohidesCursor:YES screen:nil];
+ [pdfView enableNavigationActivatedAtBottom:[[NSUserDefaults
standardUserDefaults] boolForKey:SKActivatePresentationNavigationAtBottomKey]
autohidesCursor:YES screen:screen];
}
- (IBAction)exitFullScreen:(id)sender {
@@ -2212,7 +2212,7 @@
if ([[fullScreenWindow firstResponder] isDescendantOf:pdfView])
[fullScreenWindow makeFirstResponder:nil];
- [pdfView setHasNavigation:NO activateAtBottom:NO autohidesCursor:NO
screen:nil];
+ [pdfView disableNavigation];
[pdfView setFrame:[[pdfContentBox contentView] bounds]];
[pdfContentBox addSubview:pdfView]; // this should be done before
exitPresentationMode to get a smooth transition
Modified: trunk/SKPDFView.h
===================================================================
--- trunk/SKPDFView.h 2007-08-23 15:31:23 UTC (rev 2714)
+++ trunk/SKPDFView.h 2007-08-23 17:39:40 UTC (rev 2715)
@@ -175,7 +175,8 @@
- (void)takeSnapshot:(id)sender;
-- (void)setHasNavigation:(BOOL)hasNav activateAtBottom:(BOOL)atBottom
autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen;
+- (void)enableNavigationActivatedAtBottom:(BOOL)atBottom
autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen;
+- (void)disableNavigation;
- (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page;
- (void)setNeedsDisplayForAnnotation:(PDFAnnotation *)annotation;
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2007-08-23 15:31:23 UTC (rev 2714)
+++ trunk/SKPDFView.m 2007-08-23 17:39:40 UTC (rev 2715)
@@ -2125,27 +2125,32 @@
[navWindow orderOut:self];
}
-- (void)setHasNavigation:(BOOL)hasNav activateAtBottom:(BOOL)atBottom
autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen {
- hasNavigation = hasNav;
+- (void)enableNavigationActivatedAtBottom:(BOOL)atBottom
autohidesCursor:(BOOL)hideCursor screen:(NSScreen *)screen {
+ hasNavigation = YES;
autohidesCursor = hideCursor;
activateNavigationAtBottom = atBottom;
- if (hasNavigation) {
- // always recreate the navWindow, since moving between screens of
different resolution can mess up the location (in spite of moveToScreen:)
- if (navWindow != nil)
- [navWindow release];
- else
- [[NSNotificationCenter defaultCenter] addObserver: self selector:
@selector(handleWindowWillCloseNotification:)
- name:
NSWindowWillCloseNotification object: [self window]];
- navWindow = [[SKNavigationWindow alloc] initWithPDFView:self];
- [navWindow moveToScreen:screen];
- [navWindow setLevel:[[self window] level] + 1];
- } else if ([navWindow isVisible]) {
- [navWindow orderOut:self];
- }
- [self doAutohide:autohidesCursor || hasNavigation];
+ // always recreate the navWindow, since moving between screens of
different resolution can mess up the location (in spite of moveToScreen:)
+ if (navWindow != nil)
+ [navWindow release];
+ else
+ [[NSNotificationCenter defaultCenter] addObserver: self selector:
@selector(handleWindowWillCloseNotification:)
+ name:
NSWindowWillCloseNotification object: [self window]];
+ navWindow = [[SKNavigationWindow alloc] initWithPDFView:self];
+ [navWindow moveToScreen:screen];
+ [navWindow setLevel:[[self window] level] + 1];
+
+ [self doAutohide:YES];
}
+- (void)disableNavigation {
+ hasNavigation = NO;
+ autohidesCursor = NO;
+ activateNavigationAtBottom = NO;
+
+ [navWindow orderOut:self];
+}
+
#pragma mark Menu validation
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit