1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-15 16:29:34 +00:00

only "suck" in and out when quicklook-ing when the window is visible

This commit is contained in:
Mitchell Livingston 2008-05-21 16:32:26 +00:00
parent 29ee9a2a6f
commit 132a4b7243

View file

@ -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;
}
}
}