Set window title based on type of Inspector being shown
This commit is contained in:
parent
0f2162ff7d
commit
ef63c18265
|
@ -109,6 +109,31 @@ private extension InspectorWindowController {
|
||||||
return
|
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
|
let flippedOrigin = window.flippedOrigin
|
||||||
|
|
||||||
if window.contentViewController != inspector {
|
if window.contentViewController != inspector {
|
||||||
|
|
Loading…
Reference in New Issue