Changeset 698


Ignore:
Timestamp:
Jul 26, 2006, 2:42:07 AM (15 years ago)
Author:
livings124
Message:

Minimal view status toggle now works only when on actual status text, and even if the row isn't already selected.

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r697 r698  
    11141114    }
    11151115   
    1116     //set status bar torrents
     1116    //set status bar torrent count text
    11171117    NSMutableString * totalTorrentsString = [NSMutableString stringWithString: @""];
    11181118    if (filtering)
  • trunk/macosx/TorrentTableView.m

    r694 r698  
    285285{
    286286    int row = [self rowAtPoint: point];
    287     if (row < 0 || ![self isRowSelected: row] || ![fDefaults boolForKey: @"SmallView"])
     287    if (row < 0 || ![fDefaults boolForKey: @"SmallView"])
    288288        return NO;
    289289
    290     const STATUS_WIDTH = 130.0;
     290    NSDictionary * statusAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
     291                                        [NSFont messageFontOfSize: 9.0], NSFontAttributeName, nil];
     292    Torrent * torrent = [fTorrents objectAtIndex: row];
     293    NSString * statusString = ![fDefaults boolForKey: @"SmallStatusRegular"] && [torrent isActive]
     294                            && [torrent progress] < 1.0 ? [torrent remainingTimeString] : [torrent shortStatusString];
     295   
     296    float statusWidth = [statusString sizeWithAttributes: statusAttributes].width + 3.0;
     297   
    291298    NSRect cellRect = [self frameOfCellAtColumn: [self columnWithIdentifier: @"Torrent"] row: row];
    292     NSRect statusRect = NSMakeRect(NSMaxX(cellRect) - STATUS_WIDTH, cellRect.origin.y,
    293                             STATUS_WIDTH, cellRect.size.height - BUTTON_WIDTH);
     299    NSRect statusRect = NSMakeRect(NSMaxX(cellRect) - statusWidth, cellRect.origin.y,
     300                                    statusWidth, cellRect.size.height - BUTTON_WIDTH);
    294301   
    295302    return NSPointInRect(point, statusRect);
Note: See TracChangeset for help on using the changeset viewer.