@@ -53,8 +53,10 @@ class DocumentationWindowController: NSWindowController {
53
53
name: . MenuFindAction,
54
54
object: nil )
55
55
}
56
+ }
56
57
57
- private func setupToolbar( ) {
58
+ private extension DocumentationWindowController {
59
+ func setupToolbar( ) {
58
60
let toolbar = NSToolbar ( identifier: " DocumentationWindowToolbar " )
59
61
toolbar. allowsUserCustomization = true
60
62
toolbar. autosavesConfiguration = true
@@ -68,9 +70,13 @@ class DocumentationWindowController: NSWindowController {
68
70
}
69
71
}
70
72
73
+ @objc func openDocumentationInBrowser( ) {
74
+ NSWorkspace . shared. open ( documentation. url)
75
+ }
76
+
71
77
// MARK:- NotificationCenter observers
72
78
73
- @objc private func observeViewerState( ) {
79
+ @objc func observeViewerState( ) {
74
80
guard let dvc = documentationViewController else { return }
75
81
76
82
if dvc. viewerState != . ready {
@@ -81,22 +87,22 @@ class DocumentationWindowController: NSWindowController {
81
87
dvc. useNativeScrollbars ( true )
82
88
}
83
89
84
- @objc private func observeDocumentTitle( ) {
90
+ @objc func observeDocumentTitle( ) {
85
91
guard let dvc = documentationViewController else { return }
86
92
self . window? . title = dvc. documentTitle ?? " DevDocs "
87
93
}
88
94
89
- @objc private func observeDocumentCategory( ) {
95
+ @objc func observeDocumentCategory( ) {
90
96
guard let dvc = documentationViewController else { return }
91
97
self . window? . subtitle = dvc. documentCategory ?? " "
92
98
}
93
99
94
- @objc private func observeDocumentURL( ) {
100
+ @objc func observeDocumentURL( ) {
95
101
guard let dvc = documentationViewController else { return }
96
102
self . documentation. url = dvc. documentURL
97
103
}
98
104
99
- @objc private func observeMenuFindAction( ) {
105
+ @objc func observeMenuFindAction( ) {
100
106
guard let window = self . window else { return }
101
107
if !window. isKeyWindow {
102
108
return
@@ -106,12 +112,6 @@ class DocumentationWindowController: NSWindowController {
106
112
}
107
113
}
108
114
109
- private extension DocumentationWindowController {
110
- @objc func openDocumentationInBrowser( ) {
111
- NSWorkspace . shared. open ( documentation. url)
112
- }
113
- }
114
-
115
115
// MARK:- DocumentationViewDelegate
116
116
extension DocumentationWindowController : DocumentationViewDelegate {
117
117
func selectFileToOpen( _ parameters: OpenPanelParameters , completionHandler: @escaping ( [ URL ] ? ) -> Void ) {
0 commit comments