Disable “Hide Toolbar” command for the preferences window

This commit is contained in:
1024jp 2018-12-20 15:49:19 +09:00
parent 9071140c60
commit 18d6b4968a
4 changed files with 50 additions and 1 deletions

View File

@ -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.

View File

@ -10,7 +10,7 @@
<scene sceneID="oee-cm-yzv">
<objects>
<windowController showSeguePresentationStyle="single" id="5CU-Ph-YiJ" sceneMemberID="viewController">
<window key="window" title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" tabbingMode="disallowed" id="KjF-xP-N55" customClass="NSPanel">
<window key="window" title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" tabbingMode="disallowed" id="KjF-xP-N55" customClass="PreferencesWindow" customModule="CotEditor" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
<rect key="contentRect" x="425" y="461" width="560" height="320"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>

View File

@ -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 = "<group>"; };
2AA761341D45634400031AAF /* String+Counting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Counting.swift"; sourceTree = "<group>"; };
2AA761391D457BD500031AAF /* String+Indentation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Indentation.swift"; sourceTree = "<group>"; };
2AA79C7721CB7251005AD6AD /* PreferencesWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencesWindow.swift; sourceTree = "<group>"; };
2AA7E97C1DBAAC950083B7ED /* Script.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Script.swift; sourceTree = "<group>"; };
2AA86281212ED91400BB75C9 /* NSSplitViewController+Autosave.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSSplitViewController+Autosave.swift"; sourceTree = "<group>"; };
2AAB4BF81D2435AC0049A68B /* DocumentInspectorViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DocumentInspectorViewController.swift; sourceTree = "<group>"; };
@ -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 */,

View File

@ -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)
}
}
}