@@ -97,18 +97,14 @@ class MVClockView: NSControl {
97
97
self . addSubview ( pauseIconImageView)
98
98
99
99
timerTimeLabel = MVLabel ( frame: NSMakeRect ( 0 , 94 , 150 , 20 ) )
100
- timerTimeLabel. font = timeLabelFont ( ofSize: timerTimeLabelFontSize)
100
+ timerTimeLabel. font = NSFont . systemFont ( ofSize: timerTimeLabelFontSize, weight : . medium )
101
101
timerTimeLabel. alignment = NSTextAlignment . center
102
102
timerTimeLabel. textColor = NSColor ( srgbRed: 0.749 , green: 0.1412 , blue: 0.0118 , alpha: 1.0 )
103
103
self . addSubview ( timerTimeLabel)
104
104
105
105
minutesLabel = MVLabel ( frame: NSMakeRect ( 0 , 57 , 150 , 30 ) )
106
106
minutesLabel. string = " "
107
- if #available( OSX 10 . 11 , * ) {
108
- minutesLabel. font = NSFont . systemFont ( ofSize: 35 , weight: . medium)
109
- } else {
110
- minutesLabel. font = NSFont ( name: " HelveticaNeue-Medium " , size: 35 )
111
- }
107
+ minutesLabel. font = NSFont . monospacedDigitSystemFont ( ofSize: 35 , weight: . medium)
112
108
minutesLabel. alignment = NSTextAlignment . center
113
109
minutesLabel. textColor = NSColor ( srgbRed: 0.2353 , green: 0.2549 , blue: 0.2706 , alpha: 1.0 )
114
110
self . addSubview ( minutesLabel)
@@ -126,11 +122,7 @@ class MVClockView: NSControl {
126
122
minutesLabelSecondsSuffixWidth = minutesLabelSecondsSize. width
127
123
128
124
secondsLabel = MVLabel ( frame: NSMakeRect ( 0 , 38 , 150 , 20 ) )
129
- if #available( OSX 10 . 11 , * ) {
130
- secondsLabel. font = NSFont . systemFont ( ofSize: 15 , weight: . medium)
131
- } else {
132
- secondsLabel. font = NSFont ( name: " HelveticaNeue-Medium " , size: 15 )
133
- }
125
+ secondsLabel. font = NSFont . monospacedDigitSystemFont ( ofSize: 15 , weight: . regular)
134
126
secondsLabel. alignment = NSTextAlignment . center
135
127
secondsLabel. textColor = NSColor ( srgbRed: 0.6353 , green: 0.6667 , blue: 0.6863 , alpha: 1.0 )
136
128
self . addSubview ( secondsLabel)
@@ -301,7 +293,6 @@ class MVClockView: NSControl {
301
293
self . seconds = seconds
302
294
self . handleClick ( )
303
295
}
304
-
305
296
}
306
297
}
307
298
@@ -369,15 +360,7 @@ class MVClockView: NSControl {
369
360
370
361
// If the local time format includes an " AM" or " PM" suffix, show the suffix with a smaller font
371
362
if let ampmRange = timeString. range ( of: " AM " , options: [ . caseInsensitive] ) ?? timeString. range ( of: " PM " , options: [ . caseInsensitive] ) {
372
- timerTimeLabel. setFont ( timeLabelFont ( ofSize: timerTimeLabelFontSize - 3 ) , range: NSRange ( ampmRange, in: timeString) )
373
- }
374
- }
375
-
376
- private func timeLabelFont( ofSize fontSize: CGFloat ) -> NSFont {
377
- if #available( OSX 10 . 11 , * ) {
378
- return NSFont . systemFont ( ofSize: fontSize, weight: . medium)
379
- } else {
380
- return NSFont . labelFont ( ofSize: fontSize)
363
+ timerTimeLabel. setFont ( NSFont . systemFont ( ofSize: timerTimeLabelFontSize - 3 , weight: . medium) , range: NSRange ( ampmRange, in: timeString) )
381
364
}
382
365
}
383
366
0 commit comments