From 19cb919f7533afb11d6b3c1f72796770167083fd Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Fri, 25 Jul 2014 18:19:37 +0200 Subject: [PATCH] Fix metadata table view highlight. --- .../PropertyView/English.lproj/MovieView.xib | 10 ++++---- Classes/PropertyView/SBMovieViewController.m | 25 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Classes/PropertyView/English.lproj/MovieView.xib b/Classes/PropertyView/English.lproj/MovieView.xib index e9adf19..5813396 100755 --- a/Classes/PropertyView/English.lproj/MovieView.xib +++ b/Classes/PropertyView/English.lproj/MovieView.xib @@ -1,5 +1,5 @@ - + @@ -61,8 +61,8 @@ - - + + @@ -680,8 +680,8 @@ Gw - - + + diff --git a/Classes/PropertyView/SBMovieViewController.m b/Classes/PropertyView/SBMovieViewController.m index 05ad1e0..947f098 100755 --- a/Classes/PropertyView/SBMovieViewController.m +++ b/Classes/PropertyView/SBMovieViewController.m @@ -67,12 +67,6 @@ NSString *MetadataPBoardType = @"MetadataPBoardType"; [ps setHeadIndent: -10.0]; [ps setAlignment:NSRightTextAlignment]; - detailBoldAttr = [[NSDictionary dictionaryWithObjectsAndKeys: - [NSFont boldSystemFontOfSize:11.0], NSFontAttributeName, - ps, NSParagraphStyleAttributeName, - [NSColor grayColor], NSForegroundColorAttributeName, - nil] retain]; - [mediaKind selectItemWithTag:metadata.mediaKind]; [contentRating selectItemWithTag:metadata.contentRating]; [hdVideo selectItemWithTag:metadata.hdVideo]; @@ -424,11 +418,6 @@ NSString *MetadataPBoardType = @"MetadataPBoardType"; } } -- (NSAttributedString *) boldString: (NSString *) string -{ - return [[[NSAttributedString alloc] initWithString:string attributes:detailBoldAttr] autorelease]; -} - /* TableView delegate methods */ - (NSInteger) numberOfRowsInTableView: (NSTableView *) t @@ -467,7 +456,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex { if ([tableColumn.identifier isEqualToString:@"name"]) - return [self boldString:[self.tagsArray objectAtIndex:rowIndex]]; + return [self.tagsArray objectAtIndex:rowIndex]; if ([tableColumn.identifier isEqualToString:@"value"]) return [tags objectForKey:[self.tagsArray objectAtIndex:rowIndex]]; @@ -519,6 +508,17 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn return nil; } +- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex +{ + if ([tableColumn.identifier isEqualToString:@"name"]) { + if ([[tableView selectedRowIndexes] containsIndex:rowIndex]) { + [cell setTextColor:[NSColor whiteColor]]; + } else { + [cell setTextColor:[NSColor grayColor]]; + } + } +} + - (void)tableViewColumnDidResize: (NSNotification* )notification { [dct removeAllObjects]; @@ -801,7 +801,6 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn [_tagsArray release]; [tagsMenu release]; [tabCol release]; - [detailBoldAttr release]; [ratingCell release]; [genreCell release]; [dct release];