mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Create View > Inspector submenu (#756)
This commit is contained in:
parent
aa5b3f8aed
commit
aa3107c52c
@ -13,6 +13,7 @@ unreleased
|
||||
### Improvements
|
||||
|
||||
- Give a haptic feedback on pinch zoom when the scale becomes 100%.
|
||||
- Move “Get Info” and “Show Incompatible Characters” menu items into newly added View > Inspector submenu.
|
||||
- Delete a feature alarting inconsistant encoding declaration in document on saving.
|
||||
- Avoid switching to inactive tabbed window only to show a syntax highlighting indicator.
|
||||
|
||||
|
@ -112,19 +112,6 @@
|
||||
<menuItem isSeparatorItem="YES" id="79">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Get Info" keyEquivalent="i" id="564">
|
||||
<connections>
|
||||
<action selector="getInfo:" target="Ady-hI-5gd" id="MP6-vd-LwJ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show Incompatible Characters" keyEquivalent="I" id="679">
|
||||
<connections>
|
||||
<action selector="toggleIncompatibleCharList:" target="Ady-hI-5gd" id="tKS-ZB-SMh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="335">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
<menuItem title="Close" keyEquivalent="w" id="73">
|
||||
<connections>
|
||||
<action selector="performClose:" target="Ady-hI-5gd" id="wbx-5J-ooi"/>
|
||||
@ -539,6 +526,30 @@ Gw
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="93A-bv-3Qn"/>
|
||||
<menuItem title="Inspector" id="sYa-2o-iPk">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Inspector" id="10j-rd-fWr">
|
||||
<items>
|
||||
<menuItem title="Document Inspector" keyEquivalent="i" id="564">
|
||||
<connections>
|
||||
<action selector="getInfo:" target="Ady-hI-5gd" id="MP6-vd-LwJ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Outline" id="Gch-XD-tRl">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleOutlineMenu:" target="Ady-hI-5gd" id="YG2-ee-mqD"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Incompatible Characters" id="679">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleIncompatibleCharList:" target="Ady-hI-5gd" id="tKS-ZB-SMh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Show Navigation Bar" id="681">
|
||||
<connections>
|
||||
<action selector="toggleNavigationBar:" target="Ady-hI-5gd" id="iX7-bD-yP3"/>
|
||||
|
@ -106,13 +106,17 @@ final class WindowContentViewController: NSSplitViewController, TabViewControlle
|
||||
guard let action = item.action else { return false }
|
||||
|
||||
switch action {
|
||||
case #selector(getInfo), #selector(toggleIncompatibleCharList):
|
||||
if #available(macOS 10.13, *),
|
||||
let window = self.view.window, window.isVisible, // check visiblity to avoid the window position cascading bug
|
||||
let tabGroup = window.tabGroup {
|
||||
return !tabGroup.isOverviewVisible
|
||||
}
|
||||
return true
|
||||
case #selector(getInfo):
|
||||
(item as? NSMenuItem)?.state = self.isSidebarShown(index: .documentInspector) ? .on : .off
|
||||
return self.canToggleSidebar
|
||||
|
||||
case #selector(toggleOutlineMenu):
|
||||
(item as? NSMenuItem)?.state = self.isSidebarShown(index: .outline) ? .on : .off
|
||||
return self.canToggleSidebar
|
||||
|
||||
case #selector(toggleIncompatibleCharList):
|
||||
(item as? NSMenuItem)?.state = self.isSidebarShown(index: .incompatibleCharacters) ? .on : .off
|
||||
return self.canToggleSidebar
|
||||
|
||||
default: break
|
||||
}
|
||||
@ -159,6 +163,13 @@ final class WindowContentViewController: NSSplitViewController, TabViewControlle
|
||||
}
|
||||
|
||||
|
||||
/// toggle visibility of outline menu view
|
||||
@IBAction func toggleOutlineMenu(_ sender: Any?) {
|
||||
|
||||
self.toggleVisibilityOfSidebarTabItem(index: .outline)
|
||||
}
|
||||
|
||||
|
||||
/// toggle visibility of incompatible characters list view
|
||||
@IBAction func toggleIncompatibleCharList(_ sender: Any?) {
|
||||
|
||||
@ -240,12 +251,31 @@ final class WindowContentViewController: NSSplitViewController, TabViewControlle
|
||||
}
|
||||
|
||||
|
||||
/// whether the given pane in the sidebar is currently shown
|
||||
private func isSidebarShown(index: SidebarViewController.TabIndex) -> Bool {
|
||||
|
||||
return self.isSidebarShown && (self.sidebarViewController?.selectedTabViewItemIndex == index.rawValue)
|
||||
}
|
||||
|
||||
|
||||
/// toggle visibility of pane in sidebar
|
||||
private func toggleVisibilityOfSidebarTabItem(index: SidebarViewController.TabIndex) {
|
||||
|
||||
let shown = !self.isSidebarShown || (index.rawValue != self.sidebarViewController!.selectedTabViewItemIndex)
|
||||
self.setSidebarShown(!self.isSidebarShown(index: index), index: index, animate: true)
|
||||
}
|
||||
|
||||
|
||||
/// whether sidebar state can be toggled
|
||||
private var canToggleSidebar: Bool {
|
||||
|
||||
self.setSidebarShown(shown, index: index, animate: true)
|
||||
// cannot toggle in the tab overview mode
|
||||
if #available(macOS 10.13, *),
|
||||
let window = self.view.window, window.isVisible, // check visiblity to avoid the window position cascading bug
|
||||
let tabGroup = window.tabGroup {
|
||||
return !tabGroup.isOverviewVisible
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
|
@ -84,11 +84,6 @@
|
||||
/* Class = "NSMenu"; title = "Open Recent"; ObjectID = "125"; */
|
||||
"125.title" = "Benutzte Dokumente";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Get Info"; ObjectID = "564"; */
|
||||
"564.title" = "Informationen einblenden";
|
||||
/* Class = "NSMenuItem"; title = "Show Incompatible Characters"; ObjectID = "679"; */
|
||||
"679.title" = "Inkompatible Zeichen einblenden";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Close"; ObjectID = "73"; */
|
||||
"73.title" = "Fenster schließen";
|
||||
/* Class = "NSMenuItem"; title = "Save"; ObjectID = "75"; */
|
||||
@ -277,6 +272,18 @@
|
||||
/* Class = "NSMenuItem"; title = "Customize Toolbar…"; ObjectID = "613"; */
|
||||
"613.title" = "Symbolleiste anpassen …";
|
||||
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Inspector"; ObjectID = "sYa-2o-iPk"; */
|
||||
"sYa-2o-iPk.title" = "Infofenster";
|
||||
/* Class = "NSMenu"; title = "Inspector"; ObjectID = "10j-rd-fWr"; */
|
||||
"10j-rd-fWr.title" = "Infofenster";
|
||||
/* Class = "NSMenuItem"; title = "Document Inspector"; ObjectID = "564"; */
|
||||
"564.title" = "Dokument-Informationen";
|
||||
/* Class = "NSMenuItem"; title = "Outline"; ObjectID = "679"; */
|
||||
"679.title" = "Gliederung";
|
||||
/* Class = "NSMenuItem"; title = "Incompatible Characters"; ObjectID = "679"; */
|
||||
"679.title" = "Inkompatible Zeichen";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Show Navigation Bar"; ObjectID = "681"; */
|
||||
"681.title" = "Navigationsleiste einblenden";
|
||||
/* Class = "NSMenuItem"; title = "Show Line Numbers"; ObjectID = "323"; */
|
||||
|
@ -85,11 +85,6 @@
|
||||
/* Class = "NSMenu"; title = "Open Recent"; ObjectID = "125"; */
|
||||
"125.title" = "Apri recenti";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Get Info"; ObjectID = "564"; */
|
||||
"564.title" = "Ottieni informazioni";
|
||||
/* Class = "NSMenuItem"; title = "Show Incompatible Characters"; ObjectID = "679"; */
|
||||
"679.title" = "Mostra caratteri incompatibili";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Close"; ObjectID = "73"; */
|
||||
"73.title" = "Chiudi";
|
||||
/* Class = "NSMenuItem"; title = "Save"; ObjectID = "75"; */
|
||||
@ -278,6 +273,18 @@
|
||||
/* Class = "NSMenuItem"; title = "Customize Toolbar…"; ObjectID = "613"; */
|
||||
"613.title" = "Personalizza la barra strumenti…";
|
||||
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Inspector"; ObjectID = "sYa-2o-iPk"; */
|
||||
"sYa-2o-iPk.title" = "Inspector";
|
||||
/* Class = "NSMenu"; title = "Inspector"; ObjectID = "10j-rd-fWr"; */
|
||||
"10j-rd-fWr.title" = "Inspector";
|
||||
/* Class = "NSMenuItem"; title = "Document Inspector"; ObjectID = "564"; */
|
||||
"564.title" = "Ispettore del documento";
|
||||
/* Class = "NSMenuItem"; title = "Outline"; ObjectID = "679"; */
|
||||
"679.title" = "Outline"; // FIXME: added
|
||||
/* Class = "NSMenuItem"; title = "Incompatible Characters"; ObjectID = "679"; */
|
||||
"679.title" = "Caratteri incompatibili";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Show Navigation Bar"; ObjectID = "681"; */
|
||||
"681.title" = "Mostra barra di navigazione";
|
||||
/* Class = "NSMenuItem"; title = "Show Line Numbers"; ObjectID = "323"; */
|
||||
|
@ -84,11 +84,6 @@
|
||||
/* Class = "NSMenu"; title = "Open Recent"; ObjectID = "125"; */
|
||||
"125.title" = "最近使った項目を開く";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Get Info"; ObjectID = "564"; */
|
||||
"564.title" = "情報を見る";
|
||||
/* Class = "NSMenuItem"; title = "Show Incompatible Characters"; ObjectID = "679"; */
|
||||
"679.title" = "非互換文字を表示";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Close"; ObjectID = "73"; */
|
||||
"73.title" = "閉じる";
|
||||
/* Class = "NSMenuItem"; title = "Save"; ObjectID = "75"; */
|
||||
@ -277,6 +272,18 @@
|
||||
/* Class = "NSMenuItem"; title = "Customize Toolbar…"; ObjectID = "613"; */
|
||||
"613.title" = "ツールバーをカスタマイズ…"; // Use … for auto-adding "Customize Touchbar…" below
|
||||
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Inspector"; ObjectID = "sYa-2o-iPk"; */
|
||||
"sYa-2o-iPk.title" = "インスペクタ";
|
||||
/* Class = "NSMenu"; title = "Inspector"; ObjectID = "10j-rd-fWr"; */
|
||||
"10j-rd-fWr.title" = "インスペクタ";
|
||||
/* Class = "NSMenuItem"; title = "Document Inspector"; ObjectID = "564"; */
|
||||
"564.title" = "書類情報";
|
||||
/* Class = "NSMenuItem"; title = "Outline"; ObjectID = "679"; */
|
||||
"679.title" = "アウトライン";
|
||||
/* Class = "NSMenuItem"; title = "Incompatible Characters"; ObjectID = "679"; */
|
||||
"679.title" = "非互換文字";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Show Navigation Bar"; ObjectID = "681"; */
|
||||
"681.title" = "ナビゲーションバーを表示";
|
||||
/* Class = "NSMenuItem"; title = "Show Line Numbers"; ObjectID = "323"; */
|
||||
|
@ -83,11 +83,6 @@
|
||||
/* Class = "NSMenu"; title = "Open Recent"; ObjectID = "125"; */
|
||||
"125.title" = "Abrir Recentes";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Get Info"; ObjectID = "564"; */
|
||||
"564.title" = "Obter Informações";
|
||||
/* Class = "NSMenuItem"; title = "Show Incompatible Characters"; ObjectID = "679"; */
|
||||
"679.title" = "Mostrar Caracteres Incompatíveis";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Close"; ObjectID = "73"; */
|
||||
"73.title" = "Fechar";
|
||||
/* Class = "NSMenuItem"; title = "Save"; ObjectID = "75"; */
|
||||
@ -276,6 +271,18 @@
|
||||
/* Class = "NSMenuItem"; title = "Customize Toolbar…"; ObjectID = "613"; */
|
||||
"613.title" = "Personalizar Barra de Ferramentas…";
|
||||
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Inspector"; ObjectID = "sYa-2o-iPk"; */
|
||||
"sYa-2o-iPk.title" = "Inspetor";
|
||||
/* Class = "NSMenu"; title = "Inspector"; ObjectID = "10j-rd-fWr"; */
|
||||
"10j-rd-fWr.title" = "Inspetor";
|
||||
/* Class = "NSMenuItem"; title = "Document Inspector"; ObjectID = "564"; */
|
||||
"564.title" = "Inspetor do Documento";
|
||||
/* Class = "NSMenuItem"; title = "Outline"; ObjectID = "679"; */
|
||||
"679.title" = "Outline"; // FIXME: added
|
||||
/* Class = "NSMenuItem"; title = "Incompatible Characters"; ObjectID = "679"; */
|
||||
"679.title" = "Caracteres Incompatíveis";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Show Navigation Bar"; ObjectID = "681"; */
|
||||
"681.title" = "Mostrar Barra de Navegação";
|
||||
/* Class = "NSMenuItem"; title = "Show Line Numbers"; ObjectID = "323"; */
|
||||
|
@ -85,11 +85,6 @@
|
||||
/* Class = "NSMenu"; title = "Open Recent"; ObjectID = "125"; */
|
||||
"125.title" = "打开最近使用";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Get Info"; ObjectID = "564"; */
|
||||
"564.title" = "显示简介";
|
||||
/* Class = "NSMenuItem"; title = "Show Incompatible Characters"; ObjectID = "679"; */
|
||||
"679.title" = "显示不兼容字符";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Close"; ObjectID = "73"; */
|
||||
"73.title" = "关闭";
|
||||
/* Class = "NSMenuItem"; title = "Save"; ObjectID = "75"; */
|
||||
@ -278,6 +273,18 @@
|
||||
/* Class = "NSMenuItem"; title = "Customize Toolbar…"; ObjectID = "613"; */
|
||||
"613.title" = "自定工具栏…";
|
||||
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Inspector"; ObjectID = "sYa-2o-iPk"; */
|
||||
"sYa-2o-iPk.title" = "检查器";
|
||||
/* Class = "NSMenu"; title = "Inspector"; ObjectID = "10j-rd-fWr"; */
|
||||
"10j-rd-fWr.title" = "检查器";
|
||||
/* Class = "NSMenuItem"; title = "Document Inspector"; ObjectID = "564"; */
|
||||
"564.title" = "文稿信息";
|
||||
/* Class = "NSMenuItem"; title = "Outline"; ObjectID = "679"; */
|
||||
"679.title" = "Outline"; // FIXME: added
|
||||
/* Class = "NSMenuItem"; title = "Incompatible Characters"; ObjectID = "679"; */
|
||||
"679.title" = "不兼容字符";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Show Navigation Bar"; ObjectID = "681"; */
|
||||
"681.title" = "显示导航栏";
|
||||
/* Class = "NSMenuItem"; title = "Show Line Numbers"; ObjectID = "323"; */
|
||||
|
Loading…
Reference in New Issue
Block a user