From 29f5b083c69bfbb1e4c53e1946e52f17a94a52dc Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Tue, 6 Oct 2026 10:58:20 -0700 Subject: [PATCH] Respect unread count display setting in window title. --- Mac/MainWindow/MainWindowController.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Mac/MainWindow/MainWindowController.swift b/Mac/MainWindow/MainWindowController.swift index 4fff3f21d..bd40b2600 100644 --- a/Mac/MainWindow/MainWindowController.swift +++ b/Mac/MainWindow/MainWindowController.swift @@ -111,6 +111,7 @@ final class MainWindowController: NSWindowController, NSUserInterfaceValidations NotificationCenter.default.addObserver(self, selector: #selector(refreshProgressDidChange(_:)), name: .progressInfoDidChange, object: CombinedRefreshProgress.shared) NotificationCenter.default.addObserver(self, selector: #selector(unreadCountDidChange(_:)), name: .UnreadCountDidChange, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(handleUnreadCountDisplaySettingDidChange(_:)), name: .unreadCountDisplaySettingDidChange, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(displayNameDidChange(_:)), name: .DisplayNameDidChange, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(articleThemeNamesDidChangeNotification(_:)), name: .ArticleThemeNamesDidChangeNotification, object: nil) @@ -198,6 +199,10 @@ final class MainWindowController: NSWindowController, NSUserInterfaceValidations CoalescingQueue.standard.add(self, #selector(coalescedUpdateWindowTitle)) } + @objc func handleUnreadCountDisplaySettingDidChange(_ notification: Notification) { + updateWindowTitle() + } + @objc func coalescedUpdateWindowTitle() { updateWindowTitle() } @@ -1657,6 +1662,10 @@ private extension MainWindowController { } func setSubtitle(_ count: Int) { + guard AppDefaults.shared.unreadCountDisplay == .count else { + window?.subtitle = "" + return + } let localizedLabel = NSLocalizedString("%d unread", comment: "Unread") let formattedLabel = NSString.localizedStringWithFormat(localizedLabel as NSString, count) window?.subtitle = formattedLabel as String