Changeset 5942


Ignore:
Timestamp:
May 27, 2008, 4:49:08 AM (14 years ago)
Author:
livings124
Message:

trivial efficiency

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.m

    r5940 r5942  
    535535   
    536536    //reveal button
    537     NSString * revealImageSuffix;
     537    NSString * revealImageString;
    538538    if (fMouseDownRevealButton)
    539         revealImageSuffix = @"On.png";
     539        revealImageString = @"RevealOn.png";
    540540    else if (!fTracking && fHoverReveal)
    541         revealImageSuffix = @"Hover.png";
    542     else
    543         revealImageSuffix = @"Off.png";
    544    
    545     NSImage * revealImage = [NSImage imageNamed: [@"Reveal" stringByAppendingString: revealImageSuffix]];
     541        revealImageString = @"RevealHover.png";
     542    else
     543        revealImageString = @"RevealOff.png";
     544   
     545    NSImage * revealImage = [NSImage imageNamed: revealImageString];
    546546    [revealImage setFlipped: YES];
    547547    [revealImage drawInRect: [self revealButtonRectForBounds: cellFrame] fromRect: NSZeroRect operation: NSCompositeSourceOver
     
    549549   
    550550    //action button
    551     NSString * actionImageSuffix;
     551    NSString * actionImageString;
    552552    if (fMouseDownActionButton)
    553         actionImageSuffix = @"On.png";
     553        actionImageString = @"ActionOn.png";
    554554    else if (!fTracking && fHoverAction)
    555         actionImageSuffix = @"Hover.png";
    556     else
    557         actionImageSuffix = nil;
    558    
    559     if (actionImageSuffix)
    560     {
    561         NSImage * actionImage = [NSImage imageNamed: [@"Action" stringByAppendingString: actionImageSuffix]];
     555        actionImageString = @"ActionHover.png";
     556    else
     557        actionImageString = nil;
     558   
     559    if (actionImageString)
     560    {
     561        NSImage * actionImage = [NSImage imageNamed: actionImageString];
    562562        [actionImage setFlipped: YES];
    563563        [actionImage drawInRect: [self actionButtonRectForBounds: cellFrame] fromRect: NSZeroRect operation: NSCompositeSourceOver
     
    773773            pieceColor = fBlue4Color;
    774774       
    775         //it is faster to just set color instead of checking color
     775        //it's faster to just set color instead of checking previous color
    776776        [fBitmap setColor: pieceColor atX: i y: 0];
    777777    }
Note: See TracChangeset for help on using the changeset viewer.