Skip to content

Commit

Permalink
Merged in code from existing PR to fix display on BigSur.
Browse files Browse the repository at this point in the history
hholtmann#110

Also fixed a bug in the PR which broke the "single-line" display option.
  • Loading branch information
Mike-Woolley committed Dec 19, 2020
1 parent 1cc993c commit ad93a2b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Classes/FanControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,16 @@ -(void) readFanData:(id)caller{
s_status=[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@%@%@",temp,add,fan]];
paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
[paragraphStyle setAlignment:NSLeftTextAlignment];
[s_status addAttribute:NSFontAttributeName value:[NSFont fontWithName:@"Lucida Grande" size:fsize] range:NSMakeRange(0,[s_status length])];
[s_status addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0,[s_status length])];

if (menuBarSetting == 0) {
[s_status addAttribute:NSFontAttributeName value:[NSFont fontWithName:@"Lucida Grande" size:fsize] range:NSMakeRange(0,[s_status length])];
[s_status addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0,[s_status length])];
[s_status addAttribute:NSBaselineOffsetAttributeName
value:[NSNumber numberWithFloat: -6]
range:NSMakeRange(0, s_status.length)];
[s_status addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0,[s_status length])];
}
if (setColor) [s_status addAttribute:NSForegroundColorAttributeName value:menuColor range:NSMakeRange(0,[s_status length])];


if ([statusItem respondsToSelector:@selector(button)]) {
[statusItem.button setAttributedTitle:s_status];
[statusItem.button setImage:nil];
Expand Down

0 comments on commit ad93a2b

Please sign in to comment.