mirror of
https://github.com/transmission/transmission
synced 2025-02-07 23:14:41 +00:00
make the group "ying-yang" full sized; hide dl speed columns when showing ratio
This commit is contained in:
parent
608581ea80
commit
ab6628f36b
2 changed files with 28 additions and 6 deletions
|
@ -2497,18 +2497,14 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
: [NSImage imageNamed: NSImageNameStopProgressTemplate];
|
||||
}
|
||||
else if ([ident isEqualToString: @"DL Image"])
|
||||
return ![fDefaults boolForKey: @"DisplayGroupRowRatio"] ? [NSImage imageNamed: @"DownArrowGroupTemplate.png"] : nil;
|
||||
return [NSImage imageNamed: @"DownArrowGroupTemplate.png"];
|
||||
else if ([ident isEqualToString: @"UL Image"])
|
||||
return [NSImage imageNamed: [fDefaults boolForKey: @"DisplayGroupRowRatio"]
|
||||
? @"YingYangGroupTemplate.png" : @"UpArrowGroupTemplate.png"];
|
||||
else
|
||||
{
|
||||
BOOL upload = [ident isEqualToString: @"UL"];
|
||||
if ([fDefaults boolForKey: @"DisplayGroupRowRatio"])
|
||||
{
|
||||
if (!upload)
|
||||
return nil;
|
||||
|
||||
uint64_t uploaded = 0, downloaded = 0;
|
||||
NSEnumerator * enumerator = [[item objectForKey: @"Torrents"] objectEnumerator];
|
||||
Torrent * torrent;
|
||||
|
@ -2522,6 +2518,8 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
}
|
||||
else
|
||||
{
|
||||
BOOL upload = [ident isEqualToString: @"UL"];
|
||||
|
||||
float rate = 0.0;
|
||||
NSEnumerator * enumerator = [[item objectForKey: @"Torrents"] objectEnumerator];
|
||||
Torrent * torrent;
|
||||
|
|
|
@ -48,6 +48,8 @@
|
|||
|
||||
- (BOOL) pointInGroupStatusRect: (NSPoint) point;
|
||||
|
||||
- (void) setGroupStatusColumns;
|
||||
|
||||
- (void) updateFileMenu: (NSMenu *) menu forFiles: (NSArray *) files;
|
||||
|
||||
- (void) resizePiecesBarIncrement;
|
||||
|
@ -89,6 +91,10 @@
|
|||
else
|
||||
fCollapsedGroups = [[NSMutableIndexSet alloc] init];
|
||||
|
||||
//set group columns to show ratio (nib is set to speeds)
|
||||
if ([fDefaults boolForKey: @"DisplayGroupRowRatio"])
|
||||
[self setGroupStatusColumns];
|
||||
|
||||
fMouseControlRow = -1;
|
||||
fMouseRevealRow = -1;
|
||||
fMouseActionRow = -1;
|
||||
|
@ -345,7 +351,8 @@
|
|||
if ([self pointInGroupStatusRect: point])
|
||||
{
|
||||
[fDefaults setBool: ![fDefaults boolForKey: @"DisplayGroupRowRatio"] forKey: @"DisplayGroupRowRatio"];
|
||||
[self reloadData];
|
||||
[self setGroupStatusColumns];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -776,6 +783,23 @@
|
|||
&& ![fDefaults boolForKey: @"DisplayGroupRowRatio"]);
|
||||
}
|
||||
|
||||
- (void) setGroupStatusColumns
|
||||
{
|
||||
BOOL ratio = [fDefaults boolForKey: @"DisplayGroupRowRatio"];
|
||||
|
||||
NSTableColumn * dlTableColumn = [self tableColumnWithIdentifier: @"DL"];
|
||||
if ([dlTableColumn isHidden] == ratio)
|
||||
return;
|
||||
|
||||
[dlTableColumn setHidden: ratio];
|
||||
[[self tableColumnWithIdentifier: @"DL Image"] setHidden: ratio];
|
||||
|
||||
[[self tableColumnWithIdentifier: @"UL Image"] setWidth: ratio ? 10.0 : 8.0];
|
||||
|
||||
NSTableColumn * groupTableColumn = [self tableColumnWithIdentifier: @"Group"];
|
||||
[groupTableColumn setWidth: [groupTableColumn width] + (ratio ? -2.0 : 2.0)];
|
||||
}
|
||||
|
||||
- (void) updateFileMenu: (NSMenu *) menu forFiles: (NSArray *) files
|
||||
{
|
||||
BOOL create = [menu numberOfItems] <= 0;
|
||||
|
|
Loading…
Reference in a new issue