diff --git a/CHANGELOG.md b/CHANGELOG.md index a5fb54daa..5518d0425 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Change Log - Move focus to the editor when lines are selected by clicking line numbers. - Apply update of “Show invisible characters” option in the preferences immediately to opened documents. - Change the label of the option “Count each line ending as one character” in General pane to “Ignore line endings when counting characters” (the value reversed). +- Disable “Hide Toolbar” command for the preferences window. - Improve general performance. diff --git a/CotEditor/Base.lproj/PreferencesWindow.storyboard b/CotEditor/Base.lproj/PreferencesWindow.storyboard index 3272f9a3b..8d56e460b 100644 --- a/CotEditor/Base.lproj/PreferencesWindow.storyboard +++ b/CotEditor/Base.lproj/PreferencesWindow.storyboard @@ -10,7 +10,7 @@ - + diff --git a/CotEditor/CotEditor.xcodeproj/project.pbxproj b/CotEditor/CotEditor.xcodeproj/project.pbxproj index e645c7d8a..2172a8ca0 100644 --- a/CotEditor/CotEditor.xcodeproj/project.pbxproj +++ b/CotEditor/CotEditor.xcodeproj/project.pbxproj @@ -442,6 +442,8 @@ 2AA761361D45634400031AAF /* String+Counting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AA761341D45634400031AAF /* String+Counting.swift */; }; 2AA7613A1D457BD500031AAF /* String+Indentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AA761391D457BD500031AAF /* String+Indentation.swift */; }; 2AA7613B1D457BD500031AAF /* String+Indentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AA761391D457BD500031AAF /* String+Indentation.swift */; }; + 2AA79C7821CB7251005AD6AD /* PreferencesWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AA79C7721CB7251005AD6AD /* PreferencesWindow.swift */; }; + 2AA79C7921CB7251005AD6AD /* PreferencesWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AA79C7721CB7251005AD6AD /* PreferencesWindow.swift */; }; 2AA7E97D1DBAAC950083B7ED /* Script.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AA7E97C1DBAAC950083B7ED /* Script.swift */; }; 2AA7E97E1DBAAC950083B7ED /* Script.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AA7E97C1DBAAC950083B7ED /* Script.swift */; }; 2AA86282212ED91400BB75C9 /* NSSplitViewController+Autosave.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AA86281212ED91400BB75C9 /* NSSplitViewController+Autosave.swift */; }; @@ -1117,6 +1119,7 @@ 2AA749C21D3C263300850802 /* DocumentWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DocumentWindowController.swift; sourceTree = ""; }; 2AA761341D45634400031AAF /* String+Counting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Counting.swift"; sourceTree = ""; }; 2AA761391D457BD500031AAF /* String+Indentation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Indentation.swift"; sourceTree = ""; }; + 2AA79C7721CB7251005AD6AD /* PreferencesWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencesWindow.swift; sourceTree = ""; }; 2AA7E97C1DBAAC950083B7ED /* Script.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Script.swift; sourceTree = ""; }; 2AA86281212ED91400BB75C9 /* NSSplitViewController+Autosave.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSSplitViewController+Autosave.swift"; sourceTree = ""; }; 2AAB4BF81D2435AC0049A68B /* DocumentInspectorViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DocumentInspectorViewController.swift; sourceTree = ""; }; @@ -1582,6 +1585,7 @@ isa = PBXGroup; children = ( 2A44321B219AC1F8008A0A6B /* PreferencesTabViewController.swift */, + 2AA79C7721CB7251005AD6AD /* PreferencesWindow.swift */, 2A149DC619018F9200A9D6EF /* Panes */, 2A2E03471A4BF808006ABE9F /* Syntax Edit Sheet */, 2A2E03481A4BF820006ABE9F /* Keybindings Edit Pane */, @@ -2789,6 +2793,7 @@ 2AA761361D45634400031AAF /* String+Counting.swift in Sources */, 2AA14CF91FA47E8900EAF586 /* ScriptDescriptor.swift in Sources */, 2A78BFAE1D1B138D00A583D2 /* EditPaneController.swift in Sources */, + 2AA79C7921CB7251005AD6AD /* PreferencesWindow.swift in Sources */, 2A5D13301D1FACC900D38E6A /* FindPanelLayoutManager.swift in Sources */, 2A11F2141E669BFA005E1675 /* PointerBridge.swift in Sources */, 2AA45A4C1D2E871900A1A401 /* EditorViewController.swift in Sources */, @@ -3198,6 +3203,7 @@ 2AACB1CD1D195ABD0073775B /* ShortcutKeyField.swift in Sources */, 2A6FD9ED1D3A85D700A59784 /* String+NSRange.swift in Sources */, 2A733E8920BBB4AC0090D7CB /* String+Case.swift in Sources */, + 2AA79C7821CB7251005AD6AD /* PreferencesWindow.swift in Sources */, 2ACFE58B1D20730B0005233A /* FindPanelContentViewController.swift in Sources */, 2A78BFA41D1B02ED00A583D2 /* WindowPaneController.swift in Sources */, 2AE73F40203D2FBB00D8903B /* NSLayoutManager+Range.swift in Sources */, diff --git a/CotEditor/Sources/PreferencesWindow.swift b/CotEditor/Sources/PreferencesWindow.swift new file mode 100644 index 000000000..feca4ff70 --- /dev/null +++ b/CotEditor/Sources/PreferencesWindow.swift @@ -0,0 +1,42 @@ +// +// PreferencesWindow.swift +// +// CotEditor +// https://coteditor.com +// +// Created by 1024jp on 2018-12-20. +// +// --------------------------------------------------------------------------- +// +// © 2018 1024jp +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Cocoa + +final class PreferencesWindow: NSPanel { + + /// disable "Hide Toolbar" menu item + override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool { + + switch menuItem.action { + case #selector(toggleToolbarShown)?: + return false + + default: + return super.validateMenuItem(menuItem) + } + } + +}