diff --git a/Mac/Inspector/InspectorWindowController.swift b/Mac/Inspector/InspectorWindowController.swift index 01e476bc0..b06f3d646 100644 --- a/Mac/Inspector/InspectorWindowController.swift +++ b/Mac/Inspector/InspectorWindowController.swift @@ -108,7 +108,32 @@ private extension InspectorWindowController { guard let window = window else { return } - + + switch inspector { + case is NothingInspectorViewController: + window.title = NSLocalizedString("Inspector", comment: "Inspector window title") + case is FolderInspectorViewController: + if let folderName = (inspector as? FolderInspectorViewController)?.nameTextField?.stringValue { + window.title = folderName + } else { + window.title = NSLocalizedString("Folder Inspector", comment: "Folder Inspector window title") + } + case is WebFeedInspectorViewController: + if let feedName = (inspector as? WebFeedInspectorViewController)?.nameTextField?.stringValue { + window.title = feedName + } else { + window.title = NSLocalizedString("Feed Inspector", comment: "Feed Inspector window title") + } + case is BuiltinSmartFeedInspectorViewController: + if let smartFeedName = (inspector as? BuiltinSmartFeedInspectorViewController)?.nameTextField?.stringValue { + window.title = smartFeedName + } else { + window.title = NSLocalizedString("Smart Feed Inspector", comment: "Smart Feed Inspector window title") + } + default: + window.title = NSLocalizedString("Inspector", comment: "Inspector window title") + } + let flippedOrigin = window.flippedOrigin if window.contentViewController != inspector {