mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Truncate outline menu label
This commit is contained in:
parent
004f29ba51
commit
0ef0108333
@ -37,6 +37,7 @@ develop
|
||||
- Improve encoding compatibility check.
|
||||
- Better error message on file opening.
|
||||
- Take a safety measure for in case the key binding setting file is corrupt.
|
||||
- Truncate outline label in the navigation bar by appending ellipsis if it overflows.
|
||||
- On El Capitan, make option control of the document open panel visible.
|
||||
|
||||
|
||||
|
@ -162,6 +162,11 @@ static const NSTimeInterval kDuration = 0.25;
|
||||
|
||||
NSMutableDictionary<NSString *, id> *attrs = [NSMutableDictionary dictionary];
|
||||
|
||||
NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
|
||||
[paragraphStyle setLineBreakMode:NSLineBreakByTruncatingMiddle];
|
||||
[paragraphStyle setTighteningFactorForTruncation:0]; // don't tighten
|
||||
attrs[NSParagraphStyleAttributeName] = paragraphStyle;
|
||||
|
||||
NSFontTraitMask fontTrait = [outlineItem[CEOutlineItemStyleBoldKey] boolValue] ? NSBoldFontMask : 0;
|
||||
fontTrait |= [outlineItem[CEOutlineItemStyleItalicKey] boolValue] ? NSItalicFontMask : 0;
|
||||
NSFont *font = [[NSFontManager sharedFontManager] convertFont:defaultFont toHaveTrait:fontTrait];
|
||||
|
Loading…
Reference in New Issue
Block a user