Changeset 56


Ignore:
Timestamp:
Jan 29, 2006, 7:18:03 PM (15 years ago)
Author:
titer
Message:

Show the file icon in the "Name" cell
Changed 0.5-cvs to 0.5-svn

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Jamrules

    r26 r56  
    99VERSION_MINOR  = 4 ;
    1010# VERSION_STRING = $(VERSION_MAJOR).$(VERSION_MINOR) ;
    11 VERSION_STRING = 0.5-cvs ;
     11VERSION_STRING = 0.5-svn ;
    1212
    1313DEFINES += VERSION_MAJOR=$(VERSION_MAJOR)
  • trunk/macosx/NameCell.h

    r34 r56  
    3636    NSString * fTimeString;
    3737    NSString * fPeersString;
     38
     39    NSImage * fIcon;
    3840}
    3941- (void) setStat: (tr_stat_t *) stat whiteText: (BOOL) w;
  • trunk/macosx/NameCell.m

    r34 r56  
    3434    fSizeString  = [NSString stringWithFormat: @" (%@)",
    3535                    [NSString stringForFileSize: stat->info.totalSize]];
     36
     37    fIcon = [[NSWorkspace sharedWorkspace] iconForFile:
     38                [[NSString stringWithUTF8String: stat->folder]
     39                stringByAppendingPathComponent: fNameString]];                 
     40    [fIcon setFlipped: YES];
     41
    3642    fTimeString  = @"";
    3743    fPeersString = @"";
     
    98104
    99105    pen = cellFrame.origin;
     106    float cellWidth = cellFrame.size.width;
     107
     108    pen.x += 5;
     109    pen.y += 5;                                                                 
     110    [fIcon drawAtPoint: pen fromRect:
     111        NSMakeRect(0,0,[fIcon size].width,[fIcon size].height)
     112        operation: NSCompositeSourceOver fraction: 1.0];
    100113
    101114    attributes = [NSMutableDictionary dictionaryWithCapacity: 2];
     
    106119        forKey: NSFontAttributeName];
    107120
    108     pen.x += 5; pen.y += 5;
    109     string = [[fNameString stringFittingInWidth: cellFrame.size.width -
    110         35 - [fSizeString sizeWithAttributes: attributes].width
     121    pen.x += 37;
     122    string = [[fNameString stringFittingInWidth: cellWidth -
     123        72 - [fSizeString sizeWithAttributes: attributes].width
    111124        withAttributes: attributes] stringByAppendingString: fSizeString];
    112125    [string drawAtPoint: pen withAttributes: attributes];
     
    120133    pen.x += 0; pen.y += 15;
    121134    string = [fPeersString stringFittingInWidth: cellFrame.size.width -
    122         40 withAttributes: attributes];
     135        77 withAttributes: attributes];
    123136    [string drawAtPoint: pen withAttributes: attributes];
    124137
Note: See TracChangeset for help on using the changeset viewer.