Changeset 7568


Ignore:
Timestamp:
Jan 2, 2009, 1:10:54 AM (12 years ago)
Author:
livings124
Message:

clean up the table text coloring code; trivial cleanup

Location:
trunk/macosx
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/BadgeView.h

    r7468 r7568  
    3838- (id) initWithFrame: (NSRect) frame lib: (tr_session *) lib;
    3939
    40 - (BOOL) setRatesWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRate;
     40- (void) displayRatesWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRate;
    4141- (void) setQuitting;
    4242
  • trunk/macosx/BadgeView.m

    r7468 r7568  
    5555}
    5656
    57 - (BOOL) setRatesWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRate
     57- (void) displayRatesWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRate
    5858{
    5959    //only needs update if the badges were displayed or are displayed now
    6060    if (fDownloadRate == downloadRate && fUploadRate == uploadRate)
    61         return NO;
     61        return;
    6262   
    6363    fDownloadRate = downloadRate;
    6464    fUploadRate = uploadRate;
    65     return YES;
     65    [self display];
    6666}
    6767
  • trunk/macosx/Badger.m

    r7508 r7568  
    5757{
    5858    float downloadRate = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeDownloadRate"]
    59                             ? tr_sessionGetPieceSpeed(fLib, TR_DOWN) : 0.0f;
     59                            ? tr_sessionGetPieceSpeed(fLib, TR_DOWN) : 0.0;
    6060    float uploadRate = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeUploadRate"]
    61                         ? tr_sessionGetPieceSpeed(fLib, TR_UP) : 0.0f;
     61                        ? tr_sessionGetPieceSpeed(fLib, TR_UP) : 0.0;
    6262   
    63     //only update if the badged values change
    64     if ([(BadgeView *)[[NSApp dockTile] contentView] setRatesWithDownload: downloadRate upload: uploadRate])
    65         [[NSApp dockTile] display];
     63    [(BadgeView *)[[NSApp dockTile] contentView] displayRatesWithDownload: downloadRate upload: uploadRate];
    6664}
    6765
  • trunk/macosx/FileNameCell.m

    r7114 r7568  
    140140    [[self image] drawInRect: [self imageRectForBounds: cellFrame] fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
    141141   
     142    NSColor * titleColor, * statusColor;
     143    if ([self backgroundStyle] == NSBackgroundStyleDark)
     144        titleColor = statusColor = [NSColor whiteColor];
     145    else if ([[(FileOutlineView *)[self controlView] torrent] checkForFiles: [(FileListNode *)[self objectValue] indexes]] == NSOffState)
     146        titleColor = statusColor = [NSColor disabledControlTextColor];
     147    else
     148    {
     149        titleColor = [NSColor controlTextColor];
     150        statusColor = [NSColor darkGrayColor];
     151    }
     152   
    142153    //title
    143     NSColor * specialColor = nil;
    144     if ([self isHighlighted]
    145             && [[self highlightColorWithFrame: cellFrame inView: controlView] isEqual: [NSColor alternateSelectedControlColor]])
    146         specialColor = [NSColor whiteColor];
    147     else if ([[(FileOutlineView *)[self controlView] torrent] checkForFiles: [(FileListNode *)[self objectValue] indexes]] == NSOffState)
    148         specialColor = [NSColor disabledControlTextColor];
    149     else;
    150    
    151     NSAttributedString * titleString = [self attributedTitleWithColor: specialColor ? specialColor : [NSColor controlTextColor]];
     154    NSAttributedString * titleString = [self attributedTitleWithColor: titleColor];
    152155    NSRect titleRect = [self rectForTitleWithString: titleString inBounds: cellFrame];
    153156    [titleString drawInRect: titleRect];
    154157   
    155158    //status
    156     NSAttributedString * statusString = [self attributedStatusWithColor: specialColor ? specialColor : [NSColor darkGrayColor]];
     159    NSAttributedString * statusString = [self attributedStatusWithColor: statusColor];
    157160    NSRect statusRect = [self rectForStatusWithString: statusString withTitleRect: titleRect inBounds: cellFrame];
    158161    [statusString drawInRect: statusRect];
  • trunk/macosx/GroupsController.m

    r7520 r7568  
    367367            return row;
    368368    }
    369     return -1; // Default to no group
     369    return -1;
    370370}
    371371
  • trunk/macosx/TorrentCell.m

    r7508 r7568  
    433433    //text color
    434434    NSColor * titleColor, * statusColor;
    435     if ([self isHighlighted]
    436         && [[self highlightColorWithFrame: cellFrame inView: controlView] isEqual: [NSColor alternateSelectedControlColor]])
     435    if ([self backgroundStyle] == NSBackgroundStyleDark)
    437436    {
    438437        titleColor = [NSColor whiteColor];
Note: See TracChangeset for help on using the changeset viewer.