From 132a4b724348a3ef7fc9346e07e8a39339575122 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Wed, 21 May 2008 16:32:26 +0000 Subject: [PATCH] only "suck" in and out when quicklook-ing when the window is visible --- macosx/Controller.m | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index c4ffef952..5c51f81fe 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -4056,21 +4056,24 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy - (NSRect) quickLookFrameWithURL: (NSURL *) url { - NSString * fullPath = [url path]; - NSRange visibleRows = [fTableView rowsInRect: [fTableView bounds]]; - - //do in reverse to find torrent before group - int row; - for (row = NSMaxRange(visibleRows) - 1; row >= visibleRows.location; row--) + if ([fWindow isVisible]) { - id item = [fTableView itemAtRow: row]; - if ([item isKindOfClass: [Torrent class]] && [[(Torrent *)item dataLocation] isEqualToString: fullPath]) + NSString * fullPath = [url path]; + NSRange visibleRows = [fTableView rowsInRect: [fTableView bounds]]; + + //do in reverse to find torrent before group + int row; + for (row = NSMaxRange(visibleRows) - 1; row >= visibleRows.location; row--) { - NSRect frame = [fTableView rectOfRow: row]; - frame.origin = [fTableView convertPoint: frame.origin toView: nil]; - frame.origin = [fWindow convertBaseToScreen: frame.origin]; - frame.origin.y -= frame.size.height; - return frame; + id item = [fTableView itemAtRow: row]; + if ([item isKindOfClass: [Torrent class]] && [[(Torrent *)item dataLocation] isEqualToString: fullPath]) + { + NSRect frame = [fTableView rectOfRow: row]; + frame.origin = [fTableView convertPoint: frame.origin toView: nil]; + frame.origin = [fWindow convertBaseToScreen: frame.origin]; + frame.origin.y -= frame.size.height; + return frame; + } } } -- 2.40.0