aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableStructureLoading.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-08-13 11:21:27 +0000
committerstuconnolly <stuart02@gmail.com>2012-08-13 11:21:27 +0000
commitf342cbb6c42aa92b4f2224c1158ad242475bdcb9 (patch)
tree7993d464df13d8e90491f82b218f1fb5caed766d /Source/SPTableStructureLoading.m
parent34efdf17577ee6a930b4cd60908eadd63e988097 (diff)
downloadsequelpro-f342cbb6c42aa92b4f2224c1158ad242475bdcb9.tar.gz
sequelpro-f342cbb6c42aa92b4f2224c1158ad242475bdcb9.tar.bz2
sequelpro-f342cbb6c42aa92b4f2224c1158ad242475bdcb9.zip
Default grayed out column encodings should use monospaced fonts if enabled.
Diffstat (limited to 'Source/SPTableStructureLoading.m')
-rw-r--r--Source/SPTableStructureLoading.m8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/SPTableStructureLoading.m b/Source/SPTableStructureLoading.m
index d9aa6765..99406f7a 100644
--- a/Source/SPTableStructureLoading.m
+++ b/Source/SPTableStructureLoading.m
@@ -138,9 +138,15 @@
if (defaultEncodingDescription) {
NSMenuItem *tableEncodingMenuItem = [[encodingPopupCell menu] itemWithTitle:defaultEncodingDescription];
NSMutableParagraphStyle *menuStyle = [[[NSMutableParagraphStyle alloc] init] autorelease];
+
[menuStyle setLineBreakMode:NSLineBreakByTruncatingTail];
- NSDictionary *menuAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSColor lightGrayColor], NSForegroundColorAttributeName, [NSFont systemFontOfSize: [NSFont smallSystemFontSize]], NSFontAttributeName, menuStyle, NSParagraphStyleAttributeName, nil];
+
+ NSMutableDictionary *menuAttributes = [NSMutableDictionary dictionaryWithObject:[NSColor lightGrayColor] forKey:NSForegroundColorAttributeName];
+
+ [menuAttributes setObject:[prefs boolForKey:SPUseMonospacedFonts] ? [NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]] forKey:NSFontAttributeName];
+
NSAttributedString *itemString = [[[NSAttributedString alloc] initWithString:defaultEncodingDescription attributes:menuAttributes] autorelease];
+
[[tableEncodingMenuItem onMainThread] setAttributedTitle:itemString];
}