Fix lint issues.

This commit is contained in:
Brent Simmons
2025-01-22 22:17:02 -08:00
parent 8f1379360c
commit 40ada2ba5a
91 changed files with 1278 additions and 1350 deletions

View File

@@ -8,7 +8,7 @@
import AppKit
class UnreadCountView : NSView {
class UnreadCountView: NSView {
struct Appearance {
static let padding = NSEdgeInsets(top: 1.0, left: 7.0, bottom: 1.0, right: 7.0)
@@ -31,11 +31,11 @@ class UnreadCountView : NSView {
}
private var intrinsicContentSizeIsValid = false
private var _intrinsicContentSize = NSZeroSize
private var _intrinsicContentSize = NSSize.zero
override var intrinsicContentSize: NSSize {
if !intrinsicContentSizeIsValid {
var size = NSZeroSize
var size = NSSize.zero
if unreadCount > 0 {
size = textSize()
size.width += (Appearance.padding.left + Appearance.padding.right)
@@ -46,11 +46,11 @@ class UnreadCountView : NSView {
}
return _intrinsicContentSize
}
override var isFlipped: Bool {
return true
}
override func invalidateIntrinsicContentSize() {
intrinsicContentSizeIsValid = false
}
@@ -59,7 +59,7 @@ class UnreadCountView : NSView {
private func textSize() -> NSSize {
if unreadCount < 1 {
return NSZeroSize
return NSSize.zero
}
if let cachedSize = UnreadCountView.textSizeCache[unreadCount] {
@@ -76,9 +76,9 @@ class UnreadCountView : NSView {
private func textRect() -> NSRect {
let size = textSize()
var r = NSZeroRect
var r = NSRect.zero
r.size = size
r.origin.x = (NSMaxX(bounds) - Appearance.padding.right) - r.size.width
r.origin.x = (bounds.maxX - Appearance.padding.right) - r.size.width
r.origin.y = Appearance.padding.top
return r
}
@@ -93,4 +93,3 @@ class UnreadCountView : NSView {
}
}
}