mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: removed disabling module when nothing shows in the Speed widget (#1514)
This commit is contained in:
@@ -83,7 +83,7 @@ public class StackWidget: WidgetWrapper {
|
||||
super.draw(dirtyRect)
|
||||
|
||||
guard !self.values.isEmpty else {
|
||||
self.drawNoData()
|
||||
self.setWidth(0)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -226,28 +226,6 @@ public class StackWidget: WidgetWrapper {
|
||||
})
|
||||
}
|
||||
|
||||
private func drawNoData() {
|
||||
let size: CGFloat = 15
|
||||
let lineWidth = 1 / (NSScreen.main?.backingScaleFactor ?? 1)
|
||||
let offset = lineWidth / 2
|
||||
let totalWidth: CGFloat = (Constants.Widget.margin.x*2) + size + (lineWidth*2)
|
||||
|
||||
NSColor.textColor.set()
|
||||
|
||||
var circle = NSBezierPath()
|
||||
circle = NSBezierPath(ovalIn: CGRect(x: Constants.Widget.margin.x+offset, y: 1+offset, width: size, height: size))
|
||||
circle.stroke()
|
||||
circle.lineWidth = lineWidth
|
||||
|
||||
let line = NSBezierPath()
|
||||
line.move(to: NSPoint(x: 3, y: 3.5))
|
||||
line.line(to: NSPoint(x: 13.5, y: 14))
|
||||
line.lineWidth = lineWidth
|
||||
line.stroke()
|
||||
|
||||
self.setWidth(totalWidth)
|
||||
}
|
||||
|
||||
// MARK: - Settings
|
||||
|
||||
public override func settings() -> NSView {
|
||||
|
||||
Reference in New Issue
Block a user