diff options
author | Max <post@wickenrode.com> | 2015-04-13 17:04:21 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-04-13 17:04:21 +0200 |
commit | 9a5cb83cdf913e616a0f96f4f720dc3187d650ce (patch) | |
tree | 3338682214ed247962d62127af7798c0bd6bfe80 | |
parent | 9537631e044312f6639c14b0dc5ba158ca3d3ff8 (diff) | |
download | sequelpro-9a5cb83cdf913e616a0f96f4f720dc3187d650ce.tar.gz sequelpro-9a5cb83cdf913e616a0f96f4f720dc3187d650ce.tar.bz2 sequelpro-9a5cb83cdf913e616a0f96f4f720dc3187d650ce.zip |
Dim the database name in relations view if foreign database == local database.
-rw-r--r-- | Source/SPTableRelations.m | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m index 2374ea81..5734a96d 100644 --- a/Source/SPTableRelations.m +++ b/Source/SPTableRelations.m @@ -376,7 +376,13 @@ static NSString *SPRelationOnDeleteKey = @"on_delete"; - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex { - return [[relationData objectAtIndex:rowIndex] objectForKey:[tableColumn identifier]]; + id data = [[relationData objectAtIndex:rowIndex] objectForKey:[tableColumn identifier]]; + //dim the database name if it matches the current database + if([[tableColumn identifier] isEqualToString:SPRelationFKDatabaseKey] && [[tableDocumentInstance database] isEqual:data]) { + NSDictionary *textAttributes = @{NSForegroundColorAttributeName: [NSColor lightGrayColor]}; + data = [[[NSAttributedString alloc] initWithString:(NSString *)data attributes:textAttributes] autorelease]; + } + return data; } #pragma mark - |