Use the correct selected text color (for lists)

This commit is contained in:
Allan Odgaard
2014-08-26 17:58:43 +02:00
parent 0ff652d5c9
commit e098611387
2 changed files with 4 additions and 4 deletions

View File

@@ -885,13 +885,13 @@ NSString* const FFFindWasTriggeredByEnter = @"FFFindWasTriggeredByEnter";
{
[cell setEnabled:!self.performedReplaceAll];
}
else if([[tableColumn identifier] isEqualToString:@"match"] && [cell isHighlighted])
else if([[tableColumn identifier] isEqualToString:@"match"] && [cell backgroundStyle] == NSBackgroundStyleDark)
{
id obj = [cell objectValue];
if([obj isKindOfClass:[NSAttributedString class]])
{
NSMutableAttributedString* str = [obj mutableCopy];
[str addAttribute:NSForegroundColorAttributeName value:[NSColor selectedTextColor] range:NSMakeRange(0, [str length])];
[str addAttribute:NSForegroundColorAttributeName value:[NSColor alternateSelectedControlTextColor] range:NSMakeRange(0, [str length])];
[cell setAttributedStringValue:str];
}
}

View File

@@ -272,13 +272,13 @@ static void* kOakPasteboardChooserCurrentEntryBinding = &kOakPasteboardChooserCu
- (void)tableView:(NSTableView*)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn*)aTableColumn row:(NSInteger)rowIndex
{
if([aCell isHighlighted] && [[aTableColumn identifier] isEqualToString:@"name"])
if([aCell backgroundStyle] == NSBackgroundStyleDark && [[aTableColumn identifier] isEqualToString:@"name"])
{
id obj = [aCell objectValue];
if([obj isKindOfClass:[NSAttributedString class]])
{
NSMutableAttributedString* str = [obj mutableCopy];
[str addAttribute:NSForegroundColorAttributeName value:[NSColor selectedTextColor] range:NSMakeRange(0, [str length])];
[str addAttribute:NSForegroundColorAttributeName value:[NSColor alternateSelectedControlTextColor] range:NSMakeRange(0, [str length])];
[aCell setAttributedStringValue:str];
}
}