Fix Mark All as Read confirmation popover appearing centered when triggered by keyboard shortcut. Fixes #5370.

This commit is contained in:
Brent Simmons committed 2026-08-02 13:56:18 -07:00
1 parent e9a51d775d
commit bf11af151d
1 file changed
+10 -1
+10 -1
View File
@@ -85,7 +85,8 @@ final class RootSplitViewController: UISplitViewController {
}
let articlesToMark = coordinator.articles
let title = NSLocalizedString("Mark All as Read", comment: "Command")
MarkAsReadAlertController.confirm(self, coordinator: coordinator, confirmTitle: title, sourceType: view as UIView) { [weak self] in
let completion: () -> Void = { [weak self] in
guard let self else {
return
}
@@ -93,6 +94,14 @@ final class RootSplitViewController: UISplitViewController {
self.coordinator.selectNextUnread()
}
}
// Anchor to the Mark All as Read button (keyboard shortcut has no source view).
// <https://github.com/Ranchero-Software/NetNewsWire/issues/5370>
if let markAllAsReadButton = (viewController(for: .supplementary) as? MainTimelineModernViewController)?.markAllAsReadButton {
MarkAsReadAlertController.confirm(self, coordinator: coordinator, confirmTitle: title, sourceType: markAllAsReadButton, completion: completion)
} else {
MarkAsReadAlertController.confirm(self, coordinator: coordinator, confirmTitle: title, sourceType: view as UIView, completion: completion)
}
}
@objc func markAboveAsRead(_ sender: Any?) {