mirror of
https://github.com/transmission/transmission
synced 2025-03-09 05:14:09 +00:00
Make more images static.
This commit is contained in:
parent
84ae6d401d
commit
338b2a6a19
2 changed files with 20 additions and 20 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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];
|
||||||
|
|
||||||
|
if ([torrent isPaused])
|
||||||
|
image = NSPointInRect(fClickPoint, rect) ? fResumeOnIcon : fResumeOffIcon;
|
||||||
|
else if ([torrent isActive])
|
||||||
|
image = NSPointInRect(fClickPoint, rect) ? fPauseOnIcon : fPauseOffIcon;
|
||||||
|
else
|
||||||
image = nil;
|
image = nil;
|
||||||
|
|
||||||
if( [torrent isPaused] )
|
if (image)
|
||||||
{
|
|
||||||
image = NSPointInRect( fClickPoint, rect ) ?
|
|
||||||
[NSImage imageNamed: @"ResumeOn.png"] :
|
|
||||||
[NSImage imageNamed: @"ResumeOff.png"];
|
|
||||||
}
|
|
||||||
else if( [torrent isActive] )
|
|
||||||
{
|
|
||||||
image = NSPointInRect( fClickPoint, rect ) ?
|
|
||||||
[NSImage imageNamed: @"PauseOn.png"] :
|
|
||||||
[NSImage imageNamed: @"PauseOff.png"];
|
|
||||||
}
|
|
||||||
else;
|
|
||||||
|
|
||||||
if( image )
|
|
||||||
{
|
{
|
||||||
[image setFlipped: YES];
|
[image setFlipped: YES];
|
||||||
[image drawAtPoint: rect.origin fromRect:
|
[image drawAtPoint: rect.origin fromRect:
|
||||||
|
@ -170,9 +172,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
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:
|
||||||
|
|
Loading…
Add table
Reference in a new issue