mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
instead of displaying a star for multiple priorities, display all relevant icons
This commit is contained in:
parent
c6e9e58e0c
commit
44a13d7803
4 changed files with 48 additions and 29 deletions
2
NEWS
2
NEWS
|
@ -1,5 +1,7 @@
|
|||
=== Transmission 2.32 (2011/xx/yy) ===
|
||||
[http://trac.transmissionbt.com/query?milestone=2.32&group=component&order=severity All tickets closed by this release]
|
||||
==== Mac ====
|
||||
* Lion stability fixes
|
||||
==== GTK+ ====
|
||||
* Remove GNOME desktop proxy support
|
||||
|
||||
|
|
|
@ -104,7 +104,6 @@
|
|||
A209EE5D1144B51E002B02D1 /* history.h in Headers */ = {isa = PBXBuildFile; fileRef = A209EE5B1144B51E002B02D1 /* history.h */; };
|
||||
A20B6F6B0C4D842B0034AB1D /* PriorityLow.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6F6A0C4D842B0034AB1D /* PriorityLow.png */; };
|
||||
A20B6F830C4D8A610034AB1D /* PriorityHigh.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6F820C4D8A610034AB1D /* PriorityHigh.png */; };
|
||||
A20B6F8C0C4D90980034AB1D /* PriorityMixed.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6F8B0C4D90980034AB1D /* PriorityMixed.png */; };
|
||||
A20B6FA50C4D97840034AB1D /* PriorityNone.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6FA40C4D97840034AB1D /* PriorityNone.png */; };
|
||||
A20B6FAE0C4D9B040034AB1D /* PriorityNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = A20B6FAD0C4D9B040034AB1D /* PriorityNormal.png */; };
|
||||
A20BFFB70D091CC700CE5D2B /* ToolbarSegmentedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A20BFFB60D091CC700CE5D2B /* ToolbarSegmentedCell.m */; };
|
||||
|
@ -568,7 +567,6 @@
|
|||
A209EE5B1144B51E002B02D1 /* history.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = history.h; path = libtransmission/history.h; sourceTree = "<group>"; };
|
||||
A20B6F6A0C4D842B0034AB1D /* PriorityLow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityLow.png; path = macosx/Images/PriorityLow.png; sourceTree = "<group>"; };
|
||||
A20B6F820C4D8A610034AB1D /* PriorityHigh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityHigh.png; path = macosx/Images/PriorityHigh.png; sourceTree = "<group>"; };
|
||||
A20B6F8B0C4D90980034AB1D /* PriorityMixed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityMixed.png; path = macosx/Images/PriorityMixed.png; sourceTree = "<group>"; };
|
||||
A20B6FA40C4D97840034AB1D /* PriorityNone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityNone.png; path = macosx/Images/PriorityNone.png; sourceTree = "<group>"; };
|
||||
A20B6FAD0C4D9B040034AB1D /* PriorityNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PriorityNormal.png; path = macosx/Images/PriorityNormal.png; sourceTree = "<group>"; };
|
||||
A20BFFB50D091CC700CE5D2B /* ToolbarSegmentedCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ToolbarSegmentedCell.h; path = macosx/ToolbarSegmentedCell.h; sourceTree = "<group>"; };
|
||||
|
@ -1220,7 +1218,6 @@
|
|||
A209EBD81142F52B002B02D1 /* InfoFileView.xib */,
|
||||
A209EC11114301C6002B02D1 /* InfoOptionsView.xib */,
|
||||
A20B6FA40C4D97840034AB1D /* PriorityNone.png */,
|
||||
A20B6F8B0C4D90980034AB1D /* PriorityMixed.png */,
|
||||
A20B6FAD0C4D9B040034AB1D /* PriorityNormal.png */,
|
||||
A20B6F6A0C4D842B0034AB1D /* PriorityLow.png */,
|
||||
A20B6F820C4D8A610034AB1D /* PriorityHigh.png */,
|
||||
|
@ -2045,7 +2042,6 @@
|
|||
A2F011990C27418800576FC0 /* CreateLarge.png in Resources */,
|
||||
A20B6F6B0C4D842B0034AB1D /* PriorityLow.png in Resources */,
|
||||
A20B6F830C4D8A610034AB1D /* PriorityHigh.png in Resources */,
|
||||
A20B6F8C0C4D90980034AB1D /* PriorityMixed.png in Resources */,
|
||||
A20B6FA50C4D97840034AB1D /* PriorityNone.png in Resources */,
|
||||
A20B6FAE0C4D9B040034AB1D /* PriorityNormal.png in Resources */,
|
||||
A277DA0B0C693D9C00DA2CD4 /* ActionOn.png in Resources */,
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#import "NSApplicationAdditions.h"
|
||||
#import "Torrent.h"
|
||||
|
||||
#define IMAGE_OVERLAP 3.0
|
||||
|
||||
@implementation FilePriorityCell
|
||||
|
||||
- (id) init
|
||||
|
@ -123,40 +125,59 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
NSImage * image;
|
||||
NSMutableArray * images = [NSMutableArray arrayWithCapacity: MAX(count, 1)];
|
||||
CGFloat totalWidth;
|
||||
|
||||
if (count == 0)
|
||||
image = [NSImage imageNamed: @"PriorityNone.png"];
|
||||
else if (count > 1)
|
||||
image = [NSImage imageNamed: @"PriorityMixed.png"];
|
||||
{
|
||||
NSImage * image = [NSImage imageNamed: @"PriorityNone.png"];
|
||||
[images addObject: image];
|
||||
totalWidth = [image size].width;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch ([[priorities anyObject] integerValue])
|
||||
totalWidth = 0.0;
|
||||
if ([priorities containsObject: [NSNumber numberWithInteger: TR_PRI_LOW]])
|
||||
{
|
||||
case TR_PRI_NORMAL:
|
||||
image = [NSImage imageNamed: @"PriorityNormal.png"];
|
||||
break;
|
||||
case TR_PRI_LOW:
|
||||
image = [NSImage imageNamed: @"PriorityLow.png"];
|
||||
break;
|
||||
case TR_PRI_HIGH:
|
||||
image = [NSImage imageNamed: @"PriorityHigh.png"];
|
||||
break;
|
||||
NSImage * image = [NSImage imageNamed: @"PriorityLow.png"];
|
||||
[images addObject: image];
|
||||
totalWidth += [image size].width;
|
||||
}
|
||||
if ([priorities containsObject: [NSNumber numberWithInteger: TR_PRI_NORMAL]])
|
||||
{
|
||||
NSImage * image = [NSImage imageNamed: @"PriorityNormal.png"];
|
||||
[images addObject: image];
|
||||
totalWidth += [image size].width;
|
||||
}
|
||||
if ([priorities containsObject: [NSNumber numberWithInteger: TR_PRI_HIGH]])
|
||||
{
|
||||
NSImage * image = [NSImage imageNamed: @"PriorityHigh.png"];
|
||||
[images addObject: image];
|
||||
totalWidth += [image size].width;
|
||||
}
|
||||
}
|
||||
|
||||
NSSize imageSize = [image size];
|
||||
NSRect imageRect = NSMakeRect(NSMidX(cellFrame) - imageSize.width * 0.5, NSMidY(cellFrame) - imageSize.height * 0.5,
|
||||
imageSize.width, imageSize.height);
|
||||
if (count > 1)
|
||||
totalWidth -= IMAGE_OVERLAP * (count-1);
|
||||
|
||||
if ([NSApp isOnSnowLeopardOrBetter])
|
||||
[image drawInRect: imageRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0
|
||||
respectFlipped: YES hints: nil];
|
||||
else
|
||||
CGFloat currentWidth = floor(NSMidX(cellFrame) - totalWidth * 0.5);
|
||||
|
||||
for (NSImage * image in images)
|
||||
{
|
||||
image = [image copy];
|
||||
[image setFlipped: YES];
|
||||
[image drawInRect: imageRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
|
||||
[image release];
|
||||
const NSSize imageSize = [image size];
|
||||
NSRect imageRect = NSMakeRect(currentWidth, floor(NSMidY(cellFrame) - imageSize.height * 0.5), imageSize.width, imageSize.height);
|
||||
|
||||
if ([NSApp isOnSnowLeopardOrBetter])
|
||||
[image drawInRect: imageRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil];
|
||||
else
|
||||
{
|
||||
image = [image copy];
|
||||
[image setFlipped: YES];
|
||||
[image drawInRect: imageRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
|
||||
[image release];
|
||||
}
|
||||
|
||||
currentWidth += imageSize.width - IMAGE_OVERLAP;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 299 B |
Loading…
Reference in a new issue