mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +00:00
zoom from the inspectors file table when quick looking
This commit is contained in:
parent
020353a08c
commit
75584d81ac
3 changed files with 21 additions and 15 deletions
|
@ -1143,18 +1143,28 @@ typedef enum
|
|||
return NO;
|
||||
}
|
||||
|
||||
#warning fix!
|
||||
- (NSRect) previewPanel: (QLPreviewPanel *) panel sourceFrameOnScreenForPreviewItem: (id <QLPreviewItem>) item
|
||||
{
|
||||
const NSInteger row = [[fFileController outlineView] rowForItem: item];
|
||||
if (row == -1)
|
||||
return NSZeroRect;
|
||||
FileOutlineView * fileOutlineView = [fFileController outlineView];
|
||||
|
||||
NSRect frame = [[fFileController outlineView] iconRectForRow: row];
|
||||
frame.origin = [[fFileController outlineView] convertPoint: frame.origin toView: nil];
|
||||
NSString * fullPath = [(NSURL *) item path];
|
||||
NSString * folder = [[fTorrents objectAtIndex: 0] downloadFolder];
|
||||
NSRange visibleRows = [fileOutlineView rowsInRect: [fileOutlineView bounds]];
|
||||
|
||||
for (NSUInteger row = visibleRows.location; row < NSMaxRange(visibleRows); row++)
|
||||
{
|
||||
FileListNode * rowItem = [fileOutlineView itemAtRow: row];
|
||||
if ([[folder stringByAppendingPathComponent: [rowItem fullPath]] isEqualToString: fullPath])
|
||||
{
|
||||
NSRect frame = [fileOutlineView iconRectForRow: row];
|
||||
frame.origin = [fileOutlineView convertPoint: frame.origin toView: nil];
|
||||
frame.origin = [[self window] convertBaseToScreen: frame.origin];
|
||||
frame.origin.y -= frame.size.height;
|
||||
return frame;
|
||||
}
|
||||
}
|
||||
|
||||
return NSZeroRect;
|
||||
}
|
||||
|
||||
- (void) setPiecesView: (id) sender
|
||||
|
|
|
@ -24,13 +24,14 @@
|
|||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <transmission.h>
|
||||
#import <Quartz/Quartz.h>
|
||||
|
||||
@class FileListNode;
|
||||
|
||||
#define STAT_TIME_NONE -1
|
||||
#define STAT_TIME_NOW -2
|
||||
|
||||
@interface Torrent : NSObject
|
||||
@interface Torrent : NSObject <QLPreviewItem>
|
||||
{
|
||||
tr_torrent * fHandle;
|
||||
const tr_info * fInfo;
|
||||
|
|
|
@ -1564,11 +1564,6 @@ int trashDataFile(const char * filename)
|
|||
return [NSURL fileURLWithPath: [self dataLocation]];
|
||||
}
|
||||
|
||||
- (NSString *) previewItemTitle
|
||||
{
|
||||
return [self name];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation Torrent (Private)
|
||||
|
|
Loading…
Reference in a new issue