mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fix lint issues.
This commit is contained in:
@@ -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 {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user