Revision: 6608
http://skim-app.svn.sourceforge.net/skim-app/?rev=6608&view=rev
Author: hofman
Date: 2010-07-09 09:37:34 +0000 (Fri, 09 Jul 2010)
Log Message:
-----------
duplicate code for snapshot table row rect in separate method
Modified Paths:
--------------
trunk/SKMainWindowController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2010-07-06 10:23:47 UTC (rev 6607)
+++ trunk/SKMainWindowController.m 2010-07-09 09:37:34 UTC (rev 6608)
@@ -2037,6 +2037,16 @@
[rightSideWindow collapse];
}
+- (NSRect)rowRectForSnapshotController:(SKSnapshotWindowController
*)controller scrollToVisible:(BOOL)shouldScroll {
+ 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 isPresentation] == NO) {
if ([self isFullScreen] == NO && [self rightSidePaneIsOpen] == NO) {
@@ -2047,29 +2057,13 @@
}
[self setRightSidePaneState:SKSnapshotSidePaneState];
}
-
- NSInteger row = [[rightSideController.snapshotArrayController
arrangedObjects] indexOfObject:controller];
-
- [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;
+ return [self rowRectForSnapshotController:controller scrollToVisible:YES];
}
-
(NSRect)snapshotControllerSourceRectForDeminiaturize:(SKSnapshotWindowController
*)controller {
- [[self document] addWindowController:controller];
-
- NSInteger row = [[rightSideController.snapshotArrayController
arrangedObjects] indexOfObject:controller];
- 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;
+ if ([[[self document] windowControllers] containsObject:controller] == NO)
+ [[self document] addWindowController:controller];
+ return [self rowRectForSnapshotController:controller scrollToVisible:NO];
}
- (void)showNote:(PDFAnnotation *)annotation {
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 Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit