From 6b79f6517a56c96c272cd4c2583f3431418385a9 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sun, 5 Aug 2012 23:49:18 +0000 Subject: - Fix line breaking within the encoding dropdown, addressing a regression caused by r3766 --- Source/SPTableStructureLoading.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/SPTableStructureLoading.m b/Source/SPTableStructureLoading.m index b790b384..d9aa6765 100644 --- a/Source/SPTableStructureLoading.m +++ b/Source/SPTableStructureLoading.m @@ -137,7 +137,9 @@ // Take the encoding that matches the table's encoding and gray it out if (defaultEncodingDescription) { NSMenuItem *tableEncodingMenuItem = [[encodingPopupCell menu] itemWithTitle:defaultEncodingDescription]; - NSDictionary *menuAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSColor lightGrayColor], NSForegroundColorAttributeName, [NSFont systemFontOfSize: [NSFont smallSystemFontSize]], NSFontAttributeName, nil]; + NSMutableParagraphStyle *menuStyle = [[[NSMutableParagraphStyle alloc] init] autorelease]; + [menuStyle setLineBreakMode:NSLineBreakByTruncatingTail]; + NSDictionary *menuAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSColor lightGrayColor], NSForegroundColorAttributeName, [NSFont systemFontOfSize: [NSFont smallSystemFontSize]], NSFontAttributeName, menuStyle, NSParagraphStyleAttributeName, nil]; NSAttributedString *itemString = [[[NSAttributedString alloc] initWithString:defaultEncodingDescription attributes:menuAttributes] autorelease]; [[tableEncodingMenuItem onMainThread] setAttributedTitle:itemString]; } -- cgit v1.2.3