mirror of
https://github.com/transmission/transmission
synced 2025-03-06 19:48:15 +00:00
simplify check for priority text
This commit is contained in:
parent
357f7444b0
commit
f8fa5dc7a4
1 changed files with 7 additions and 6 deletions
|
@ -54,7 +54,8 @@
|
|||
Torrent * torrent = [(InfoWindowController *)[[[self controlView] window] windowController] selectedTorrent];
|
||||
NSSet * priorities = [torrent filePrioritiesForIndexes: [fItem objectForKey: @"Indexes"]];
|
||||
|
||||
if ([priorities count] == 0)
|
||||
int count = [priorities count];
|
||||
if (count == 0)
|
||||
return;
|
||||
|
||||
BOOL low = [priorities containsObject: [NSNumber numberWithInt: TR_PRI_LOW]],
|
||||
|
@ -82,12 +83,12 @@
|
|||
[NSFont messageFontOfSize: 18.0], NSFontAttributeName, nil];
|
||||
|
||||
NSString * text;
|
||||
if (low && !normal && !high)
|
||||
text = @"-";
|
||||
else if (!low && !normal && high)
|
||||
text = @"+";
|
||||
else
|
||||
if (count > 1)
|
||||
text = @"*";
|
||||
else if (low)
|
||||
text = @"-";
|
||||
else
|
||||
text = @"+";
|
||||
|
||||
NSSize textSize = [text sizeWithAttributes: attributes];
|
||||
NSRect textRect = NSMakeRect(cellFrame.origin.x + (cellFrame.size.width - textSize.width) * 0.5,
|
||||
|
|
Loading…
Add table
Reference in a new issue