Changeset 378


Ignore:
Timestamp:
Jun 16, 2006, 1:50:10 AM (16 years ago)
Author:
livings124
Message:

Make more images static.

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.m

    r377 r378  
    3333- (void) placeBar: (NSImage *) barImage width: (float) width point: (NSPoint) point;
    3434- (void) buildSimpleBar: (float) width point: (NSPoint) point;
    35 - (void) buildAdvancedBar: (float) width point: (NSPoint) point;
     35- (void) buildAdvancedBar: (float) widthFloat point: (NSPoint) point;
    3636
    3737@end
  • trunk/macosx/TorrentTableView.m

    r376 r378  
    4545@implementation TorrentTableView
    4646
     47static NSImage * fResumeOnIcon, * fResumeOffIcon, * fPauseOnIcon, * fPauseOffIcon,
     48                * fRevealOnIcon, * fRevealOffIcon;
     49
    4750- (void) awakeFromNib
    4851{
     52    fResumeOnIcon = [NSImage imageNamed: @"ResumeOn.png"];
     53    fResumeOffIcon = [NSImage imageNamed: @"ResumeOff.png"];
     54    fPauseOnIcon = [NSImage imageNamed: @"PauseOn.png"];
     55    fPauseOffIcon = [NSImage imageNamed: @"PauseOff.png"];
     56    fRevealOnIcon = [NSImage imageNamed: @"RevealOn.png"];
     57    fRevealOffIcon = [NSImage imageNamed: @"RevealOff.png"];
     58
    4959    [fContextRow setTitle: @"Context"];
    5060    [fContextNoRow setTitle: @"Context"];
     
    146156        torrent = [fTorrents objectAtIndex: i];
    147157        rect  = [self pauseRectForRow: i];
    148         image = nil;
    149 
    150         if( [torrent isPaused] )
    151         {
    152             image = NSPointInRect( fClickPoint, rect ) ?
    153                 [NSImage imageNamed: @"ResumeOn.png"] :
    154                 [NSImage imageNamed: @"ResumeOff.png"];
    155         }
    156         else if( [torrent isActive] )
    157         {
    158             image = NSPointInRect( fClickPoint, rect ) ?
    159                 [NSImage imageNamed: @"PauseOn.png"] :
    160                 [NSImage imageNamed: @"PauseOff.png"];
    161         }
    162         else;
    163 
    164         if( image )
     158
     159        if ([torrent isPaused])
     160            image = NSPointInRect(fClickPoint, rect) ? fResumeOnIcon : fResumeOffIcon;
     161        else if ([torrent isActive])
     162            image = NSPointInRect(fClickPoint, rect) ? fPauseOnIcon : fPauseOffIcon;
     163        else
     164            image = nil;
     165
     166        if (image)
    165167        {
    166168            [image setFlipped: YES];
     
    170172        }
    171173
    172         rect  = [self revealRectForRow: i];
    173         image = NSPointInRect( fClickPoint, rect ) ?
    174             [NSImage imageNamed: @"RevealOn.png"] :
    175             [NSImage imageNamed: @"RevealOff.png"];
     174        rect = [self revealRectForRow: i];
     175        image = NSPointInRect(fClickPoint, rect) ? fRevealOnIcon : fRevealOffIcon;
    176176        [image setFlipped: YES];
    177177        [image drawAtPoint: rect.origin fromRect:
Note: See TracChangeset for help on using the changeset viewer.