From 8886d935e933c6239aa9b35e900d96f7d07527c7 Mon Sep 17 00:00:00 2001 From: dmoagx Date: Fri, 16 Mar 2012 20:19:17 +0000 Subject: * Moves the background color code for SPTextView into the class. Fixes #1073 --- Source/SPTextView.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Source/SPTextView.m') diff --git a/Source/SPTextView.m b/Source/SPTextView.m index 500e4892..6611d6f8 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -180,7 +180,9 @@ NSInteger _alphabeticSort(id string1, id string2, void *reverse) #ifndef SP_REFACTOR [self setQueryHiliteColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorHighlightQueryColor]]]; - [self setQueryEditorBackgroundColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorBackgroundColor]]]; + NSColor *backgroundColor = [NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorBackgroundColor]]; + [self setQueryEditorBackgroundColor:backgroundColor]; + [self setBackgroundColor:backgroundColor]; [self setCommentColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorCommentColor]]]; [self setQuoteColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorQuoteColor]]]; [self setKeywordColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorSQLKeywordColor]]]; @@ -240,7 +242,9 @@ NSInteger _alphabeticSort(id string1, id string2, void *reverse) { #ifndef SP_REFACTOR if ([keyPath isEqualToString:SPCustomQueryEditorBackgroundColor]) { - [self setQueryEditorBackgroundColor:[NSUnarchiver unarchiveObjectWithData:[change objectForKey:NSKeyValueChangeNewKey]]]; + NSColor *backgroundColor = [NSUnarchiver unarchiveObjectWithData:[change objectForKey:NSKeyValueChangeNewKey]]; + [self setQueryEditorBackgroundColor:backgroundColor]; + [self setBackgroundColor:backgroundColor]; [self setNeedsDisplayInRect:[self bounds]]; } else if ([keyPath isEqualToString:SPCustomQueryEditorFont]) { [self setFont:[NSUnarchiver unarchiveObjectWithData:[change objectForKey:NSKeyValueChangeNewKey]]]; -- cgit v1.2.3