Revision: 3580
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3580&view=rev
Author:   hofman
Date:     2008-03-30 09:38:07 -0700 (Sun, 30 Mar 2008)

Log Message:
-----------
Remember the window frame for snapshots for revert and across launches.

Modified Paths:
--------------
    trunk/SKSnapshotWindowController.m

Modified: trunk/SKSnapshotWindowController.m
===================================================================
--- trunk/SKSnapshotWindowController.m  2008-03-30 16:10:25 UTC (rev 3579)
+++ trunk/SKSnapshotWindowController.m  2008-03-30 16:38:07 UTC (rev 3580)
@@ -55,6 +55,7 @@
 #define SCALE_FACTOR_KEY            @"scaleFactor"
 #define AUTO_FITS_KEY               @"autoFits"
 #define HAS_WINDOW_KEY              @"hasWindow"
+#define WINDOW_FRAME_KEY            @"windowFrame"
 
 static NSString *SKSnapshotWindowFrameAutosaveName = @"SKSnapshotWindow";
 static NSString *SKSnapshotViewChangedNotification = 
@"SKSnapshotViewChangedNotification";
@@ -238,7 +239,9 @@
           goToPageNumber:[[setup objectForKey:PAGE_KEY] unsignedIntValue]
                     rect:NSRectFromString([setup objectForKey:RECT_KEY])
                 autoFits:[[setup objectForKey:AUTO_FITS_KEY] boolValue]];
-           
+    
+    if ([setup objectForKey:WINDOW_FRAME_KEY])
+        [[self window] setFrame:NSRectFromString([setup 
objectForKey:WINDOW_FRAME_KEY]) display:NO];
     if ([[setup objectForKey:HAS_WINDOW_KEY] boolValue])
         [self performSelector:@selector(showWindow:) withObject:self 
afterDelay:0.0];
 }
@@ -307,7 +310,7 @@
     NSView *clipView = [[[pdfView documentView] enclosingScrollView] 
contentView];
     NSRect rect = [pdfView convertRect:[pdfView convertRect:[clipView bounds] 
fromView:clipView] toPage:[pdfView currentPage]];
     BOOL autoFits = [pdfView respondsToSelector:@selector(autoFits)] && 
[(BDSKZoomablePDFView *)pdfView autoFits];
-    return [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber 
numberWithUnsignedInt:[self pageIndex]], PAGE_KEY, NSStringFromRect(rect), 
RECT_KEY, [NSNumber numberWithFloat:[pdfView scaleFactor]], SCALE_FACTOR_KEY, 
[NSNumber numberWithBool:autoFits], AUTO_FITS_KEY, [NSNumber 
numberWithBool:[[self window] isVisible]], HAS_WINDOW_KEY, nil];
+    return [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber 
numberWithUnsignedInt:[self pageIndex]], PAGE_KEY, NSStringFromRect(rect), 
RECT_KEY, [NSNumber numberWithFloat:[pdfView scaleFactor]], SCALE_FACTOR_KEY, 
[NSNumber numberWithBool:autoFits], AUTO_FITS_KEY, [NSNumber 
numberWithBool:[[self window] isVisible]], HAS_WINDOW_KEY, 
NSStringFromRect([[self window] frame]), WINDOW_FRAME_KEY, nil];
 }
 
 #pragma mark Actions


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to