diff --git a/macosx/FileNameCell.m b/macosx/FileNameCell.m index d3a2ca0b6..6ffb3ed0e 100644 --- a/macosx/FileNameCell.m +++ b/macosx/FileNameCell.m @@ -89,20 +89,25 @@ [[self image] drawInRect: [self imageRectForBounds: cellFrame] fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; - BOOL highlighted = [self isHighlighted] && [[self highlightColorWithFrame: cellFrame inView: controlView] - isEqual: [NSColor alternateSelectedControlColor]]; + Torrent * torrent = [[[[self controlView] window] windowController] selectedTorrent]; //title - NSAttributedString * titleString = [self attributedTitleWithColor: highlighted ? [NSColor whiteColor] - : [NSColor controlTextColor]]; + NSColor * specialColor = nil; + if ([self isHighlighted] + && [[self highlightColorWithFrame: cellFrame inView: controlView] isEqual: [NSColor alternateSelectedControlColor]]) + specialColor = [NSColor whiteColor]; + else if ([torrent checkForFiles: [[self objectValue] objectForKey: @"Indexes"]] == NSOffState) + specialColor = [NSColor disabledControlTextColor]; + else; + + NSAttributedString * titleString = [self attributedTitleWithColor: specialColor ? specialColor : [NSColor controlTextColor]]; NSRect titleRect = [self rectForTitleWithString: titleString inBounds: cellFrame]; [titleString drawInRect: titleRect]; //status if (![[[self objectValue] objectForKey: @"IsFolder"] boolValue]) { - NSAttributedString * statusString = [self attributedStatusWithColor: highlighted ? [NSColor whiteColor] - : [NSColor darkGrayColor]]; + NSAttributedString * statusString = [self attributedStatusWithColor: specialColor ? specialColor : [NSColor darkGrayColor]]; NSRect statusRect = [self rectForStatusWithString: statusString inBounds: cellFrame]; [statusString drawInRect: statusRect]; } diff --git a/macosx/FileOutlineView.m b/macosx/FileOutlineView.m index c548c7f5e..814ed0227 100644 --- a/macosx/FileOutlineView.m +++ b/macosx/FileOutlineView.m @@ -112,23 +112,28 @@ { NSDictionary * item = [self itemAtRow: row]; Torrent * torrent = [(InfoWindowController *)[[self window] windowController] selectedTorrent]; + NSIndexSet * indexes = [item objectForKey: @"Indexes"]; - - NSSet * priorities = [torrent filePrioritiesForIndexes: [item objectForKey: @"Indexes"]]; - int count = [priorities count]; - if (count == 0) + if ([torrent checkForFiles: indexes] == NSOffState) [fNormalColor set]; - else if (count > 1) - [fMixedPriorityColor set]; else { - int priority = [[priorities anyObject] intValue]; - if (priority == TR_PRI_LOW) - [fLowPriorityColor set]; - else if (priority == TR_PRI_HIGH) - [fHighPriorityColor set]; - else + NSSet * priorities = [torrent filePrioritiesForIndexes: indexes]; + int count = [priorities count]; + if (count == 0) [fNormalColor set]; + else if (count > 1) + [fMixedPriorityColor set]; + else + { + int priority = [[priorities anyObject] intValue]; + if (priority == TR_PRI_LOW) + [fLowPriorityColor set]; + else if (priority == TR_PRI_HIGH) + [fHighPriorityColor set]; + else + [fNormalColor set]; + } } NSRect rect = [self rectOfRow: row]; diff --git a/macosx/NSMenuAdditions.m b/macosx/NSMenuAdditions.m index 92be8a1b4..75c9001b2 100644 --- a/macosx/NSMenuAdditions.m +++ b/macosx/NSMenuAdditions.m @@ -35,7 +35,7 @@ for (i = [indexes lastIndex]; i != NSNotFound; i = [indexes indexLessThanIndex: i]) { item = [[menu itemAtIndex:i] retain]; - [menu removeItem: item]; + [menu removeItemAtIndex: i]; [self insertItem: item atIndex: bottom]; [item release]; }