aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableRelations.m
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-04-13 17:04:21 +0200
committerMax <post@wickenrode.com>2015-04-13 17:04:21 +0200
commit9a5cb83cdf913e616a0f96f4f720dc3187d650ce (patch)
tree3338682214ed247962d62127af7798c0bd6bfe80 /Source/SPTableRelations.m
parent9537631e044312f6639c14b0dc5ba158ca3d3ff8 (diff)
downloadsequelpro-9a5cb83cdf913e616a0f96f4f720dc3187d650ce.tar.gz
sequelpro-9a5cb83cdf913e616a0f96f4f720dc3187d650ce.tar.bz2
sequelpro-9a5cb83cdf913e616a0f96f4f720dc3187d650ce.zip
Dim the database name in relations view if foreign database == local database.
Diffstat (limited to 'Source/SPTableRelations.m')
-rw-r--r--Source/SPTableRelations.m8
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 -