Changeset 9321


Ignore:
Timestamp:
Oct 18, 2009, 2:02:22 PM (13 years ago)
Author:
livings124
Message:

get rid of copying the priority images and elliminate another setFlipped: on 10.6

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.h

    r9010 r9321  
    3232            fHoverControl, fHoverReveal, fHoverAction;
    3333   
    34     NSImage * fHighPriorityImage, * fLowPriorityImage;
    35    
    3634    NSColor * fBarBorderColor, * fBluePieceColor;
    3735}
  • trunk/macosx/TorrentCell.m

    r9316 r9321  
    108108        fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0f green: 0.4f blue: 0.8f alpha: 1.0f] retain];
    109109        fBarBorderColor = [[NSColor colorWithCalibratedWhite: 0.0f alpha: 0.2f] retain];
    110        
    111         fHighPriorityImage = [[NSImage imageNamed: @"PriorityHigh.png"] copy];
    112         [fHighPriorityImage setFlipped: YES];
    113        
    114         fLowPriorityImage = [[NSImage imageNamed: @"PriorityLow.png"] copy];
    115         [fLowPriorityImage setFlipped: YES];
    116110    }
    117111        return self;
     
    479473    if ([torrent priority] != TR_PRI_NORMAL)
    480474    {
    481         NSImage * priorityImage = [torrent priority] == TR_PRI_HIGH ? fHighPriorityImage : fLowPriorityImage;
     475        NSImage * priorityImage = [torrent priority] == TR_PRI_HIGH ? [NSImage imageNamed: @"PriorityHigh.png"]
     476                                                                    : [NSImage imageNamed: @"PriorityLow.png"];
    482477       
    483478        NSRect priorityRect = NSMakeRect(NSMaxX(titleRect) + PADDING_BETWEEN_TITLE_AND_PRIORITY,
    484479                                titleRect.origin.y - (PRIORITY_ICON_HEIGHT - titleRect.size.height) / 2.0,
    485480                                PRIORITY_ICON_WIDTH, PRIORITY_ICON_HEIGHT);
    486         [priorityImage drawInRect: priorityRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
     481       
     482        [self drawImage: priorityImage inRect: priorityRect];
    487483    }
    488484   
Note: See TracChangeset for help on using the changeset viewer.