mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: increased swiftlint file_length rule from 600 to 800
This commit is contained in:
@@ -45,5 +45,5 @@ type_body_length:
|
||||
- 400
|
||||
|
||||
file_length:
|
||||
- 600
|
||||
- 800
|
||||
- 800
|
||||
- 1000
|
||||
@@ -505,7 +505,7 @@ public class HalfCircleGraphView: NSView {
|
||||
|
||||
context.restoreGState()
|
||||
|
||||
if self.text != nil {
|
||||
if let text = self.text {
|
||||
let style = NSMutableParagraphStyle()
|
||||
style.alignment = .center
|
||||
let stringAttributes = [
|
||||
@@ -514,10 +514,9 @@ public class HalfCircleGraphView: NSView {
|
||||
NSAttributedString.Key.paragraphStyle: style
|
||||
]
|
||||
|
||||
let width: CGFloat = self.text!.widthOfString(usingFont: NSFont.systemFont(ofSize: 10))
|
||||
let height: CGFloat = self.text!.heightOfString(usingFont: NSFont.systemFont(ofSize: 10))
|
||||
let rect = CGRect(x: ((self.frame.width-width)/2)-0.5, y: (self.frame.height-6)/2, width: width, height: height)
|
||||
let str = NSAttributedString.init(string: self.text!, attributes: stringAttributes)
|
||||
let width: CGFloat = text.widthOfString(usingFont: NSFont.systemFont(ofSize: 10))
|
||||
let rect = CGRect(x: ((self.frame.width-width)/2)-0.5, y: (self.frame.height-6)/2, width: width, height: 13)
|
||||
let str = NSAttributedString.init(string: text, attributes: stringAttributes)
|
||||
str.draw(with: rect)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//
|
||||
// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.
|
||||
//
|
||||
// swiftlint:disable file_length
|
||||
|
||||
import Cocoa
|
||||
import Kit
|
||||
@@ -156,7 +155,7 @@ internal class SensorView: NSStackView {
|
||||
self.valueView = ValueSensorView(sensor, width: width, callback: { [weak self] in
|
||||
self?.open()
|
||||
})
|
||||
self.chartView = ChartSensorView(width: width)
|
||||
self.chartView = ChartSensorView(width: width, suffix: sensor.unit)
|
||||
|
||||
self.addArrangedSubview(self.valueView)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user