@@ -61,21 +61,20 @@ class AppDelegate: NSObject, NSApplicationDelegate {
61
61
var statusBarTextAttributes : [ NSAttributedString . Key : Any ] {
62
62
let paragraphStyle = NSMutableParagraphStyle ( )
63
63
paragraphStyle. alignment = . right
64
+ paragraphStyle. maximumLineHeight = 10
65
+ var map = [ NSAttributedString . Key : Any] ( )
64
66
if let font = NSFont ( name: " SFMono-Regular " , size: 9 ) {
65
- paragraphStyle. maximumLineHeight = 10
66
67
paragraphStyle. paragraphSpacing = - 5
67
- return [
68
- NSAttributedString . Key . font : font ,
69
- NSAttributedString . Key. paragraphStyle : paragraphStyle
70
- ] as [ NSAttributedString . Key : Any ]
68
+ map [ NSAttributedString . Key . font ] = font
69
+ if #available ( macOS 11 , * ) {
70
+ map [ NSAttributedString . Key. baselineOffset ] = - 4
71
+ }
71
72
} else {
72
- paragraphStyle. maximumLineHeight = 10
73
73
paragraphStyle. paragraphSpacing = - 7
74
- return [
75
- NSAttributedString . Key. font : NSFont . monospacedDigitSystemFont ( ofSize: 9 , weight: . regular) ,
76
- NSAttributedString . Key. paragraphStyle: paragraphStyle
77
- ] as [ NSAttributedString . Key : Any ]
74
+ map [ NSAttributedString . Key. font] = NSFont . monospacedDigitSystemFont ( ofSize: 9 , weight: . regular)
78
75
}
76
+ map [ NSAttributedString . Key. paragraphStyle] = paragraphStyle
77
+ return map
79
78
}
80
79
81
80
func updateSpeed( ) {
0 commit comments