File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -161,16 +161,11 @@ - (NSAttributedString*) attributedTitleWithParams:(NSDictionary *)params {
161
161
NSString * title = truncLength < titleLength ? [[fullTitle substringToIndex: truncLength] stringByAppendingString: @" …" ] : fullTitle;
162
162
163
163
CGFloat size = params[@" size" ] ? [params[@" size" ] floatValue ] : 14 ;
164
- NSFont * font;
165
- if ([NSFont respondsToSelector: @selector (monospacedDigitSystemFontOfSize:weight: )]) {
166
- font = [self isFontValid: params[@" font" ]] ? [NSFont fontWithName: params[@" font" ] size: size]
167
- : [NSFont monospacedDigitSystemFontOfSize: size weight: NSFontWeightRegular ]
168
- ?: [NSFont monospacedDigitSystemFontOfSize: size weight: NSFontWeightRegular ];
169
- } else {
170
- font = [self isFontValid: params[@" font" ]] ? [NSFont fontWithName: params[@" font" ] size: size]
171
- : [NSFont menuFontOfSize: size]
172
- ?: [NSFont menuFontOfSize: size];
173
- }
164
+ NSFont * font = ([self isFontValid: params[@" font" ]] ? [NSFont fontWithName: params[@" font" ] size: size]
165
+ : nil )
166
+ ?: [NSFont respondsToSelector: @selector (monospacedDigitSystemFontOfSize:weight: )]
167
+ ? [NSFont monospacedDigitSystemFontOfSize: size weight: NSFontWeightRegular ]
168
+ : [NSFont menuFontOfSize: size];
174
169
175
170
NSDictionary * attributes = @{NSFontAttributeName : font, NSBaselineOffsetAttributeName : @1 };
176
171
BOOL parseANSI = [fullTitle containsANSICodes ] && ![[params[@" ansi" ] lowercaseString ] isEqualToString: @" false" ];
You can’t perform that action at this time.
0 commit comments