1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-09 13:50:00 +00:00

Make more images static.

This commit is contained in:
Mitchell Livingston 2006-06-16 01:50:10 +00:00
parent 84ae6d401d
commit 338b2a6a19
2 changed files with 20 additions and 20 deletions

View file

@ -32,7 +32,7 @@
- (void) placeBar: (NSImage *) barImage width: (float) width point: (NSPoint) point; - (void) placeBar: (NSImage *) barImage width: (float) width point: (NSPoint) point;
- (void) buildSimpleBar: (float) width point: (NSPoint) point; - (void) buildSimpleBar: (float) width point: (NSPoint) point;
- (void) buildAdvancedBar: (float) width point: (NSPoint) point; - (void) buildAdvancedBar: (float) widthFloat point: (NSPoint) point;
@end @end

View file

@ -44,8 +44,18 @@
@implementation TorrentTableView @implementation TorrentTableView
static NSImage * fResumeOnIcon, * fResumeOffIcon, * fPauseOnIcon, * fPauseOffIcon,
* fRevealOnIcon, * fRevealOffIcon;
- (void) awakeFromNib - (void) awakeFromNib
{ {
fResumeOnIcon = [NSImage imageNamed: @"ResumeOn.png"];
fResumeOffIcon = [NSImage imageNamed: @"ResumeOff.png"];
fPauseOnIcon = [NSImage imageNamed: @"PauseOn.png"];
fPauseOffIcon = [NSImage imageNamed: @"PauseOff.png"];
fRevealOnIcon = [NSImage imageNamed: @"RevealOn.png"];
fRevealOffIcon = [NSImage imageNamed: @"RevealOff.png"];
[fContextRow setTitle: @"Context"]; [fContextRow setTitle: @"Context"];
[fContextNoRow setTitle: @"Context"]; [fContextNoRow setTitle: @"Context"];
} }
@ -145,23 +155,15 @@
{ {
torrent = [fTorrents objectAtIndex: i]; torrent = [fTorrents objectAtIndex: i];
rect = [self pauseRectForRow: i]; rect = [self pauseRectForRow: i];
image = nil;
if( [torrent isPaused] ) if ([torrent isPaused])
{ image = NSPointInRect(fClickPoint, rect) ? fResumeOnIcon : fResumeOffIcon;
image = NSPointInRect( fClickPoint, rect ) ? else if ([torrent isActive])
[NSImage imageNamed: @"ResumeOn.png"] : image = NSPointInRect(fClickPoint, rect) ? fPauseOnIcon : fPauseOffIcon;
[NSImage imageNamed: @"ResumeOff.png"]; else
} image = nil;
else if( [torrent isActive] )
{
image = NSPointInRect( fClickPoint, rect ) ?
[NSImage imageNamed: @"PauseOn.png"] :
[NSImage imageNamed: @"PauseOff.png"];
}
else;
if( image ) if (image)
{ {
[image setFlipped: YES]; [image setFlipped: YES];
[image drawAtPoint: rect.origin fromRect: [image drawAtPoint: rect.origin fromRect:
@ -169,10 +171,8 @@
NSCompositeSourceOver fraction: 1.0]; NSCompositeSourceOver fraction: 1.0];
} }
rect = [self revealRectForRow: i]; rect = [self revealRectForRow: i];
image = NSPointInRect( fClickPoint, rect ) ? image = NSPointInRect(fClickPoint, rect) ? fRevealOnIcon : fRevealOffIcon;
[NSImage imageNamed: @"RevealOn.png"] :
[NSImage imageNamed: @"RevealOff.png"];
[image setFlipped: YES]; [image setFlipped: YES];
[image drawAtPoint: rect.origin fromRect: [image drawAtPoint: rect.origin fromRect:
NSMakeRect(0, 0, BUTTON_WIDTH, BUTTON_WIDTH) operation: NSMakeRect(0, 0, BUTTON_WIDTH, BUTTON_WIDTH) operation: