TextMate is a graphical text editor for OS X 10.7+
Revision | d19e2fa49e4803b758f0ccdbdd38b5b3d6de0e8d (tree) |
---|---|
Time | 2012-08-23 04:15:17 |
Author | Gerd Knops <gerti@bita...> |
Commiter | Allan Odgaard |
BundleEditor: follow truncated names with ellipsis
@@ -455,9 +455,19 @@ static be::entry_ptr parent_for_column (NSBrowser* aBrowser, NSInteger aColumn, | ||
455 | 455 | { |
456 | 456 | if(NSBrowserCell* cell = [aCell isKindOfClass:[NSBrowserCell class]] ? aCell : nil) |
457 | 457 | { |
458 | + static NSMutableParagraphStyle* paragraphStyle = nil; | |
459 | + if(!paragraphStyle) | |
460 | + { | |
461 | + paragraphStyle = [[NSMutableParagraphStyle alloc] init]; | |
462 | + [paragraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; | |
463 | + } | |
464 | + | |
458 | 465 | be::entry_ptr entry = parent_for_column(aBrowser, aColumn, bundles)->children()[aRow]; |
459 | - | |
460 | - NSDictionary* attrs = @{ NSForegroundColorAttributeName : entry->disabled() ? [NSColor grayColor] : [NSColor blackColor] }; | |
466 | + | |
467 | + NSDictionary* attrs = @{ | |
468 | + NSForegroundColorAttributeName : entry->disabled() ? [NSColor grayColor] : [NSColor blackColor], | |
469 | + NSParagraphStyleAttributeName : paragraphStyle | |
470 | + }; | |
461 | 471 | [cell setAttributedStringValue:[[[NSAttributedString alloc] initWithString:[NSString stringWithCxxString:entry->name()] attributes:attrs] autorelease]]; |
462 | 472 | [cell setLeaf:!entry->has_children()]; |
463 | 473 | [cell setLoaded:YES]; |