Changeset 5163


Ignore:
Timestamp:
Feb 28, 2008, 4:40:14 PM (14 years ago)
Author:
livings124
Message:

make the group "ying-yang" full sized; hide dl speed columns when showing ratio

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r5161 r5163  
    24982498        }
    24992499        else if ([ident isEqualToString: @"DL Image"])
    2500             return ![fDefaults boolForKey: @"DisplayGroupRowRatio"] ? [NSImage imageNamed: @"DownArrowGroupTemplate.png"] : nil;
     2500            return [NSImage imageNamed: @"DownArrowGroupTemplate.png"];
    25012501        else if ([ident isEqualToString: @"UL Image"])
    25022502            return [NSImage imageNamed: [fDefaults boolForKey: @"DisplayGroupRowRatio"]
     
    25042504        else
    25052505        {
    2506             BOOL upload = [ident isEqualToString: @"UL"];
    25072506            if ([fDefaults boolForKey: @"DisplayGroupRowRatio"])
    25082507            {
    2509                 if (!upload)
    2510                     return nil;
    2511                
    25122508                uint64_t uploaded = 0, downloaded = 0;
    25132509                NSEnumerator * enumerator = [[item objectForKey: @"Torrents"] objectEnumerator];
     
    25232519            else
    25242520            {
     2521                BOOL upload = [ident isEqualToString: @"UL"];
     2522               
    25252523                float rate = 0.0;
    25262524                NSEnumerator * enumerator = [[item objectForKey: @"Torrents"] objectEnumerator];
  • trunk/macosx/TorrentTableView.m

    r5156 r5163  
    4949- (BOOL) pointInGroupStatusRect: (NSPoint) point;
    5050
     51- (void) setGroupStatusColumns;
     52
    5153- (void) updateFileMenu: (NSMenu *) menu forFiles: (NSArray *) files;
    5254
     
    9092            fCollapsedGroups = [[NSMutableIndexSet alloc] init];
    9193       
     94        //set group columns to show ratio (nib is set to speeds)
     95        if ([fDefaults boolForKey: @"DisplayGroupRowRatio"])
     96            [self setGroupStatusColumns];
     97       
    9298        fMouseControlRow = -1;
    9399        fMouseRevealRow = -1;
     
    346352    {
    347353        [fDefaults setBool: ![fDefaults boolForKey: @"DisplayGroupRowRatio"] forKey: @"DisplayGroupRowRatio"];
    348         [self reloadData];
     354        [self setGroupStatusColumns];
     355       
    349356        return;
    350357    }
     
    775782            || (([ident isEqualToString: @"DL"] || [ident isEqualToString: @"DL Image"])
    776783            && ![fDefaults boolForKey: @"DisplayGroupRowRatio"]);
     784}
     785
     786- (void) setGroupStatusColumns
     787{
     788    BOOL ratio = [fDefaults boolForKey: @"DisplayGroupRowRatio"];
     789   
     790    NSTableColumn * dlTableColumn = [self tableColumnWithIdentifier: @"DL"];
     791    if ([dlTableColumn isHidden] == ratio)
     792        return;
     793   
     794    [dlTableColumn setHidden: ratio];
     795    [[self tableColumnWithIdentifier: @"DL Image"] setHidden: ratio];
     796   
     797    [[self tableColumnWithIdentifier: @"UL Image"] setWidth: ratio ? 10.0 : 8.0];
     798   
     799    NSTableColumn * groupTableColumn = [self tableColumnWithIdentifier: @"Group"];
     800    [groupTableColumn setWidth: [groupTableColumn width] + (ratio ? -2.0 : 2.0)];
    777801}
    778802
Note: See TracChangeset for help on using the changeset viewer.