Changeset 9040


Ignore:
Timestamp:
Sep 5, 2009, 1:58:13 AM (13 years ago)
Author:
livings124
Message:

zoom from the inspectors file table when quick looking

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r9038 r9040  
    11441144}
    11451145
    1146 #warning fix!
    11471146- (NSRect) previewPanel: (QLPreviewPanel *) panel sourceFrameOnScreenForPreviewItem: (id <QLPreviewItem>) item
    11481147{
    1149     const NSInteger row = [[fFileController outlineView] rowForItem: item];
    1150     if (row == -1)
    1151         return NSZeroRect;
    1152    
    1153     NSRect frame = [[fFileController outlineView] iconRectForRow: row];
    1154     frame.origin = [[fFileController outlineView] convertPoint: frame.origin toView: nil];
    1155     frame.origin = [[self window] convertBaseToScreen: frame.origin];
    1156     frame.origin.y -= frame.size.height;
    1157     return frame;
     1148    FileOutlineView * fileOutlineView = [fFileController outlineView];
     1149   
     1150    NSString * fullPath = [(NSURL *) item path];
     1151    NSString * folder = [[fTorrents objectAtIndex: 0] downloadFolder];
     1152    NSRange visibleRows = [fileOutlineView rowsInRect: [fileOutlineView bounds]];
     1153   
     1154    for (NSUInteger row = visibleRows.location; row < NSMaxRange(visibleRows); row++)
     1155    {
     1156        FileListNode * rowItem = [fileOutlineView itemAtRow: row];
     1157        if ([[folder stringByAppendingPathComponent: [rowItem fullPath]] isEqualToString: fullPath])
     1158        {
     1159            NSRect frame = [fileOutlineView iconRectForRow: row];
     1160            frame.origin = [fileOutlineView convertPoint: frame.origin toView: nil];
     1161            frame.origin = [[self window] convertBaseToScreen: frame.origin];
     1162            frame.origin.y -= frame.size.height;
     1163            return frame;
     1164        }
     1165    }
     1166   
     1167    return NSZeroRect;
    11581168}
    11591169
  • trunk/macosx/Torrent.h

    r9016 r9040  
    2525#import <Cocoa/Cocoa.h>
    2626#import <transmission.h>
     27#import <Quartz/Quartz.h>
    2728
    2829@class FileListNode;
     
    3132#define STAT_TIME_NOW -2
    3233
    33 @interface Torrent : NSObject
     34@interface Torrent : NSObject <QLPreviewItem>
    3435{
    3536    tr_torrent * fHandle;
  • trunk/macosx/Torrent.m

    r9034 r9040  
    15631563{
    15641564    return [NSURL fileURLWithPath: [self dataLocation]];
    1565 }
    1566 
    1567 - (NSString *) previewItemTitle
    1568 {
    1569     return [self name];
    15701565}
    15711566
Note: See TracChangeset for help on using the changeset viewer.