Revision: 6802
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6802&view=rev
Author:   hofman
Date:     2010-09-13 00:30:16 +0000 (Mon, 13 Sep 2010)

Log Message:
-----------
combine snapshot delegate methods for miniaturized rect

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

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2010-09-13 00:23:04 UTC (rev 6801)
+++ trunk/SKMainWindowController.m      2010-09-13 00:30:16 UTC (rev 6802)
@@ -2065,18 +2065,9 @@
     [rightSideWindow collapse];
 }
 
-- (NSRect)rowRectForSnapshotController:(SKSnapshotWindowController 
*)controller scrollToVisible:(BOOL)shouldScroll {
+- (NSRect)snapshotController:(SKSnapshotWindowController *)controller 
miniaturizedRect:(BOOL)isMiniaturize {
     NSInteger row = [[rightSideController.snapshotArrayController 
arrangedObjects] indexOfObject:controller];
-    if (shouldScroll)
-        [rightSideController.snapshotTableView scrollRowToVisible:row];
-    NSRect rect = [rightSideController.snapshotTableView frameOfCellAtColumn:0 
row:row];
-    rect = [rightSideController.snapshotTableView convertRect:rect toView:nil];
-    rect.origin = [[rightSideController.snapshotTableView window] 
convertBaseToScreen:rect.origin];
-    return rect;
-}
-
-- 
(NSRect)snapshotControllerTargetRectForMiniaturize:(SKSnapshotWindowController 
*)controller {
-    if ([self interactionMode] != SKPresentationMode) {
+    if (isMiniaturize && [self interactionMode] != SKPresentationMode) {
         if ([self interactionMode] == SKNormalMode && [self 
rightSidePaneIsOpen] == NO) {
             [self toggleRightSidePane:self];
         } else if ([self interactionMode] == SKFullScreenMode && 
([rightSideWindow state] == NSDrawerClosedState || [rightSideWindow state] == 
NSDrawerClosingState)) {
@@ -2084,14 +2075,14 @@
             [NSTimer scheduledTimerWithTimeInterval:1.0 target:self 
selector:@selector(hideRightSideWindow:) userInfo:NULL repeats:NO];
         }
         [self setRightSidePaneState:SKSnapshotSidePaneState];
+        [rightSideController.snapshotTableView scrollRowToVisible:row];
     }
-    return [self rowRectForSnapshotController:controller scrollToVisible:YES];
+    NSRect rect = [rightSideController.snapshotTableView frameOfCellAtColumn:0 
row:row];
+    rect = [rightSideController.snapshotTableView convertRect:rect toView:nil];
+    rect.origin = [[rightSideController.snapshotTableView window] 
convertBaseToScreen:rect.origin];
+    return rect;
 }
 
-- 
(NSRect)snapshotControllerSourceRectForDeminiaturize:(SKSnapshotWindowController
 *)controller {
-    return [self rowRectForSnapshotController:controller scrollToVisible:NO];
-}
-
 - (void)showNote:(PDFAnnotation *)annotation {
     NSWindowController *wc = [self windowControllerForNote:annotation];
     if (wc == nil) {

Modified: trunk/SKSnapshotWindowController.h
===================================================================
--- trunk/SKSnapshotWindowController.h  2010-09-13 00:23:04 UTC (rev 6801)
+++ trunk/SKSnapshotWindowController.h  2010-09-13 00:30:16 UTC (rev 6802)
@@ -98,8 +98,7 @@
 - (void)snapshotControllerDidFinishSetup:(SKSnapshotWindowController 
*)controller;
 - (void)snapshotControllerWillClose:(SKSnapshotWindowController *)controller;
 - (void)snapshotControllerDidChange:(SKSnapshotWindowController *)controller;
-- 
(NSRect)snapshotControllerTargetRectForMiniaturize:(SKSnapshotWindowController 
*)controller;
-- 
(NSRect)snapshotControllerSourceRectForDeminiaturize:(SKSnapshotWindowController
 *)controller;
+- (NSRect)snapshotController:(SKSnapshotWindowController *)controller 
miniaturizedRect:(BOOL)isMiniaturize;
 
 @end
 

Modified: trunk/SKSnapshotWindowController.m
===================================================================
--- trunk/SKSnapshotWindowController.m  2010-09-13 00:23:04 UTC (rev 6801)
+++ trunk/SKSnapshotWindowController.m  2010-09-13 00:30:16 UTC (rev 6802)
@@ -480,8 +480,8 @@
 }
 
 - (void)miniaturize {
-    if ([[self delegate] 
respondsToSelector:@selector(snapshotControllerTargetRectForMiniaturize:)]) {
-        NSRect startRect, endRect, dockRect = [[self delegate] 
snapshotControllerTargetRectForMiniaturize:self];
+    if ([[self delegate] 
respondsToSelector:@selector(snapshotController:miniaturizedRect:)]) {
+        NSRect startRect, endRect, dockRect = [[self delegate] 
snapshotController:self miniaturizedRect:YES];
         
         [self getMiniRect:&endRect maxiRect:&startRect 
forDockingRect:dockRect];
         
@@ -500,8 +500,8 @@
 }
 
 - (void)deminiaturize {
-    if ([[self delegate] 
respondsToSelector:@selector(snapshotControllerSourceRectForDeminiaturize:)]) {
-        NSRect startRect, endRect, dockRect = [[self delegate] 
snapshotControllerSourceRectForDeminiaturize:self];
+    if ([[self delegate] 
respondsToSelector:@selector(snapshotController:miniaturizedRect:)]) {
+        NSRect startRect, endRect, dockRect = [[self delegate] 
snapshotController:self miniaturizedRect:NO];
         
         [self getMiniRect:&startRect maxiRect:&endRect 
forDockingRect:dockRect];
         


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

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to