mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-22 15:50:17 +01:00
Set window title based on type of Inspector being shown
This commit is contained in:
parent
0f2162ff7d
commit
ef63c18265
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user