better method of determining if a table cell is highlighted

This commit is contained in:
Mitchell Livingston 2007-11-30 02:49:40 +00:00
parent aed1da89fd
commit 3858f817c5
2 changed files with 2 additions and 4 deletions

View File

@ -91,8 +91,7 @@
//title
NSColor * specialColor = nil;
if ([self isHighlighted]
&& [[self highlightColorWithFrame: cellFrame inView: controlView] isEqual: [NSColor alternateSelectedControlColor]])
if ([self isHighlighted] && [[controlView window] isKeyWindow] && [[controlView window] firstResponder] == controlView)
specialColor = [NSColor whiteColor];
else if ([[(FileOutlineView *)[self controlView] torrent] checkForFiles:
[[self objectValue] objectForKey: @"Indexes"]] == NSOffState)

View File

@ -223,8 +223,7 @@
//text color
NSColor * titleColor, * statusColor;
if ([self isHighlighted]
&& [[self highlightColorWithFrame: cellFrame inView: controlView] isEqual: [NSColor alternateSelectedControlColor]])
if ([self isHighlighted] && [[controlView window] isKeyWindow] && [[controlView window] firstResponder] == controlView)
{
titleColor = [NSColor whiteColor];
statusColor = [NSColor whiteColor];