diff --git a/NetNewsWire/AppDefaults.swift b/NetNewsWire/AppDefaults.swift index a1788c90a..89762e1b4 100644 --- a/NetNewsWire/AppDefaults.swift +++ b/NetNewsWire/AppDefaults.swift @@ -58,6 +58,7 @@ struct AppDefaults { // Hidden prefs static let showTitleOnMainWindow = "KafasisTitleMode" + static let hideDockUnreadCount = "Issue246HideDockUnreadCount" } private static let smallestFontSizeRawValue = FontSize.small.rawValue @@ -111,6 +112,10 @@ struct AppDefaults { return bool(for: Key.showTitleOnMainWindow) } + static var hideDockUnreadCount: Bool { + return bool(for: Key.hideDockUnreadCount) + } + static var timelineSortDirection: ComparisonResult { get { return sortDirection(for: Key.timelineSortDirection) diff --git a/NetNewsWire/AppDelegate.swift b/NetNewsWire/AppDelegate.swift index 50b3b3c2c..8b5afc61c 100644 --- a/NetNewsWire/AppDelegate.swift +++ b/NetNewsWire/AppDelegate.swift @@ -347,7 +347,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, // MARK: - Dock Badge @objc func updateDockBadge() { - let label = unreadCount > 0 ? "\(unreadCount)" : "" + let label = unreadCount > 0 && !AppDefaults.hideDockUnreadCount ? "\(unreadCount)" : "" NSApplication.shared.dockTile.badgeLabel = label }