Revision: 5421
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5421&view=rev
Author:   hofman
Date:     2009-06-13 11:31:03 +0000 (Sat, 13 Jun 2009)

Log Message:
-----------
set side pane widths from setup bookmark on already open document

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2009-06-13 11:30:22 UTC (rev 5420)
+++ trunk/SKMainWindowController.m      2009-06-13 11:31:03 UTC (rev 5421)
@@ -541,16 +541,59 @@
 - (void)applySetup:(NSDictionary *)setup{
     if ([self isWindowLoaded] == NO) {
         [savedNormalSetup setDictionary:setup];
-    } else if ([self isFullScreen] || [self isPresentation]) {
+    } else {
+        
         NSString *rectString = [setup objectForKey:SKMainWindowFrameKey];
         if (rectString)
             [mainWindow setFrame:NSRectFromString([setup 
objectForKey:SKMainWindowFrameKey]) display:YES];
+        
+        NSNumber *leftWidth = [setup objectForKey:LEFTSIDEPANEWIDTH_KEY];
+        NSNumber *rightWidth = [setup objectForKey:RIGHTSIDEPANEWIDTH_KEY];
+        if (leftWidth && rightWidth) {
+            CGFloat width = [leftWidth floatValue];
+            NSRect frame;
+            if (width >= 0.0) {
+                frame = [leftSideContentView frame];
+                frame.size.width = width;
+                if (mwcFlags.usesDrawers == 0) {
+                    [leftSideContentView setFrame:frame];
+                } else if (width > 0.0) {
+                    [leftSideDrawer setContentSize:frame.size];
+                    [leftSideDrawer openOnEdge:NSMinXEdge];
+                } else {
+                    [leftSideDrawer close];
+                }
+            }
+            width = [rightWidth floatValue];
+            if (width >= 0.0) {
+                frame = [rightSideContentView frame];
+                frame.size.width = width;
+                if (mwcFlags.usesDrawers == 0) {
+                    frame.origin.x = NSMaxX([splitView bounds]) - width;
+                    [rightSideContentView setFrame:frame];
+                } else if (width > 0.0) {
+                    [rightSideDrawer setContentSize:frame.size];
+                    [rightSideDrawer openOnEdge:NSMaxXEdge];
+                } else {
+                    [rightSideDrawer close];
+                }
+            }
+            if (mwcFlags.usesDrawers == 0) {
+                frame = [pdfSplitView frame];
+                frame.size.width = NSWidth([splitView frame]) - 
NSWidth([leftSideContentView frame]) - NSWidth([rightSideContentView frame]) - 
2 * [splitView dividerThickness];
+                frame.origin.x = NSMaxX([leftSideContentView frame]) + 
[splitView dividerThickness];
+                [pdfSplitView setFrame:frame];
+            }
+        }
+        
         NSUInteger pageIndex = [[setup objectForKey:PAGEINDEX_KEY] 
unsignedIntValue];
         if (pageIndex != NSNotFound)
             [pdfView goToPage:[[pdfView document] pageAtIndex:pageIndex]];
+        
         NSArray *snapshotSetups = [setup objectForKey:SNAPSHOTS_KEY];
         if ([snapshotSetups count])
             [self showSnapshotsWithSetups:snapshotSetups];
+        
         if ([self isFullScreen] || [self isPresentation])
             [savedNormalSetup addEntriesFromDictionary:setup];
         else


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

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to