Merge pull request #584 from incanus/246-dock-unread-pref
add hidden pref for show/hide dock unread count
This commit is contained in:
commit
976d52ad49
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue